It is possible to trigger a plot on a fault, or any other condition. This involves making a user program that monitors for the error condition, then triggers the plot. Triggering will provide plot data from before the moment the trigger occurs, which is very helpful for troubleshooting.
Here is how to do it:
Set up the Plot Configuration Trigger Settings
Add the data items you need in order to see the problem, such as positions, velocities, Control Output, etc.
- In the Plot Configuration Editor, choose Custom Plot, then, towards the bottom, click the Edit Trigger Setting button.
- Uncheck Enable Automatic Trigger (this prevents the plot from triggering when you don’t want it triggered).
- Choose Manual Rearm.
- Set the Pre-Trigger Percent to your desired value, such as 50%.
Make the User Program
The user program must do the following:
- Send the Rearm Plot (103) command
- Wait for the error condition to occur
- Send the Trigger Plot (102) command.
For example, this user program waits for the Axis 0 Halted bit to turn on:
Set the task to not stop when an axis halts.
This is necessary, because otherwise the task will stop, and the Trigger Plot command will never be sent!
- In the Project window, right-click Programming and choose Properties.
- On the Halts page, set the task to not stop when an axis halts.
Optional: Stop the Event Log
In addition to triggering the plot, you can stop the Event Log. This gives you even more good troubleshooting detail.
- In the user program, add a Pause/Resume Log (95) command to the same step that sends the Trigger Plot (102)command.
Run the Program
Once you have followed the instructions above, run the user program. When the error condition occurs, the plot will be triggered. You can return at some later time and upload the plot and view the Event Log. The plot remains in the RMC until it is powered off, or until the plot is rearmed. The Event Log remains until the RMC is powered off. Remember to resume the Event Log after you have the info you need.