# Triggering a Plot on an Error Condition

**URL:** <https://forum.deltamotion.com/t/triggering-a-plot-on-an-error-condition/154>\
**Category:** Knowledge Base: Troubleshooting\
**Created:** [November 4, 2011, 7:02pm UTC](https://forum.deltamotion.com/t/triggering-a-plot-on-an-error-condition/154 "2011-11-04T19:02:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Paso](https://forum.deltamotion.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@Jacob\_Paso](https://forum.deltamotion.com/u/Jacob_Paso)\
**Post date:** [November 4, 2011, 7:02pm UTC](https://forum.deltamotion.com/t/triggering-a-plot-on-an-error-condition/154/1 "2011-11-04T19:02:08Z")

</div>

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**  
Create a new plot template and 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](https://forum.deltamotion.com/uploads/default/original/1X/a76adb23c3180c19121b71aa343034cf0058b359.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:

 ![userprog.png](https://forum.deltamotion.com/uploads/default/original/1X/401f4d0a9a5cbac823105bd55c9c67b7f5377532.png)  
**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.
