Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

event triggers


crs Apr 2, 2018 11:10 PM

I have defined an "events" table to record changes to various operating modes during my data collection, which is called only when those events are identified in the code.  This allows me to track changes in operation via timestamped entries in this events log, which I can correlate with the separtely stored data from the other tables.  

One of the recorded events is corresponds to the start of the program (before the main scan loop), and I would like to include a complementary event when the program stops.  Since the program normally runs in a continuous scan loop, there doesn't seem to be a logical code point for a CallTable instruction.  Is there an internal event triggering system in CR BASIC that could recognize a "Stop" command and allow me to execute a few lines of code before terminating the program?  


DAM Apr 3, 2018 01:47 PM

The ShutdownBegin/ShutdownEnd syntax allows you to execute CRBASIC instructions when the program stop is caused by loading a new program or using the Stop program controls of LoggerNet. This does not execute on a power cycle as the system does not know this "stop" is imminent.


crs Apr 3, 2018 07:13 PM

Thanks - exactly what I wanted.  

Log in or register to post/reply in the forum.