Hi
Here is an example how you could do it.
I assume you have defined a do signal for the system output MotSupTrig.
First declare a intnum VAR intnum intMotSupTrig
Then you need to hook up the trigg with the trap routine (something like this).
IDelete intMotSupTrig; Connect intMotSupTrig WITH MotionError; ISignalDO doTriggSignal,1,intMotSupTrig;
I use the IDelete to delete the interrupt before I create it because if it allready exist you will get an error. The doTriggSignal is the signal that triggs the interrupt and it will trigg when the signal goes to “1”.
The you add a trap routine where you have your recovery code
TRAP MotionError ! Do your stuff here ENDTRAP
Hope this will give you a hint how to use trap routines
The event routine concept allows one to configure the system to execute user-defined code when specific system events, i.e. PowerOn, Startup, etc. occur. The events themselves cannot be defined.
Interrupts and trap routines allow the user to handle data/value change events from user-level IO or data, rather than system-level events.