LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reboot due to Watchdog?

Is there a way to check if the last reboot of a sbRIO has been triggered by the watchdog ?

 

Thanks in advance,

regards,

Marco

0 Kudos
Message 1 of 6
(3,233 Views)

When I handle the watchdog reboot on cRIO and FieldPoint, I write out a file with the contents of my data queue, so I can repopulate the queue on reboot; then delete the file.  If the file exists on reboot, then reboot was caused by the watchdog, otherwise reboot was not caused by the watchdog.  Same approach should work with just a marker file.  Of course you have to handle the reboot occurrance yourself, and not let it trigger the restart.

 

Matt

Message 2 of 6
(3,224 Views)

Thanks for replying Matt.

 

The problem is that I use the watchdog to trigger a reboot in case the software hangs (as a last remedy...).

I would prefer to avoid software handling of the occurrence...

 

Regards,

Marco

0 Kudos
Message 3 of 6
(3,203 Views)

Hmm.  Is there an unused I/O pin pair where you can set the state of the output pin and have the state be different between a watchdog reboot and power up?  Something like force to 0 on power up, set it to 1 once your code is running.  If the watchdog restart doesn't force to 0, just read the pin to know what your previous state was.  You could accomplish the same thing with just an external OR gate.  Wire one input to an output pin of the sbRIO, wire the other input pin to the OR output.  As long as the OR has power and has been set, it will read 1 after a watchdog reset and 0 for a power up restart.  You will have to watch your startup transients, but this approach should do what you want.

 

Matt

Message 4 of 6
(3,185 Views)

If I remember correctly, shared variables on VxWorks will maintain their state after a reboot. (that is if I remember correctly)

 

As such, you could use a shared variable in conjunction with your watchdog.  Every time you reset the watchdog, you could also reset an incrementing shared variable or something similar.  Alternatively, in the case of a safe shutdown you could set the variable to a known state.  Then check the variable when you come back up and you should be able to tell what your last state was.

 

Not sure how well this will work for a hardware reboot, but it can at least rule out a controlled reboot.

Chris
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 5 of 6
(3,165 Views)

thank you Chris.

We would like to avoid the use of shared variables.

 

At the moment  we are trying an approach based on FPGA code saved on the Flash memory ab the sbRIO.

 

Regards,

Marco

 

 

 

 

0 Kudos
Message 6 of 6
(3,150 Views)