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.

Detection of Program Load on CR1000


dryden Mar 4, 2012 09:44 PM

With a program using PreserveVariables, is there any programming technique which will allow me to detect when the logger program was just loaded (as opposed to restarted due to a power outage)?


jtrauntvein Mar 5, 2012 03:02 PM

You can examine the value of the ProgSignature value in the status table. If anything in the program has changed, this value will be different from the previous run.


dryden Mar 5, 2012 05:25 PM

Thank you very much. I was hoping as much.

What I'm really trying to do is simulate the CR10X situation where all the variables are initialized to zero when a new program is loaded by my users. You wouldn't happen to have a approach for that would you?


Dana Mar 6, 2012 07:08 PM

The CRx000 dataloggers have a value in the Status table that might give you what you want. There is a StartUpCode. This value is 0 if a program is sent to the datalogger or if the user triggers a recompile of the program (or the datalogger does a watchdog reset and the program is recompiled, I think -- haven't confirmed the watchdog case). However, if the datalogger is power cycled and the program recompiles, the startup code will be set to 1.

You can access this value programmatically using the Data Table Access syntax (explained in the help). So, for instance, you could populate a variable that could be monitored using:

MyStartUpVar=Status.StartUpCode

Dana W.

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