How to detect cold-restart of AC800M controller .
We have a requirement where a set of actions are to be performed only when the controller(AC800M PM865/864) is cold restarted. Do we have any accessible status register/variable which indicates that the last successful restart/download was a cold-restart.
Voted best answer
To find if the conroller was cold-restarted is to have variable-flag with "retain" attribute. For instance "CR_detect" is boolean retain variable that getting true at controller startup. Default value of CR_detect is "false".
If CR_detect = false then
(*Write here your code if controller has been cold-restarted or initially started up*)
CR_detect := true;
else
(*Write here your code if controller has been warm-restarted*)
End_if;
Et voila!
Answers
All the code that needs to be executed only once at application startup are to be written in a code block with name "Start_".
If this doesnt suit your needs, There are some ac800m functions that can help you out...
Try looking for "FirstScanAfterApplicationStart"
One of the ways to find if the conroller was cold-restarted is to check the controller log file.Find for a message called "delete application |application name|".This means a cold restart was performed on the controller.A warm download will have information as "Start Application |application name|" in the log files
Add new comment