Triggering a Plot on an Error Condition


#1

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:

  1. 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.
  2. In the Plot Configuration Editor, choose Custom Plot, then, towards the bottom, click the Edit Trigger Setting button.
  3. Uncheck Enable Automatic Trigger (this prevents the plot from triggering when you don’t want it triggered).
  4. Choose Manual Rearm.
  5. Set the Pre-Trigger Percent to your desired value, such as 50%.

For example:
plotconfig.png
Make the User Program
The user program must do the following:

  1. Send the Rearm Plot (103) command
  2. Wait for the error condition to occur
  3. 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!

  1. In the Project window, right-click Programming and choose Properties.
  2. 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.

  1. 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.