To download NI software, including the products shown below, visit ni.com/downloads.
This example demonstrates how to use a Watchdog Timer to reboot a cRIO if the system became unresponsible.
Description
This example program provides a solution for the problem shows in KnowledgeBase 4ROEMHXY: Why Won't My VxWorks Controller Reboot or Ping Itself? Using the watchdog timer vi's available under the Functions Palette»Real-Time»RT Watchdog we are able to cause the cRIO to reboot.
This example has two loops. The top loop represents your Real-Time Code by making the User LED on the cRIO blink, this also allows you to visually see when the cRIO Reboots itself. (You can also use Console Out to see when the cRIO reboots).
The Bottom Loop is the Watchdog Loop. While the Unresponsible Program button is un-pressed the watchdog is "wacked" each iteration of the loop. When the case structure becomes true, the watchdog timer times out after 1 second. When the watchdog times out it executes it's timeout actions, which in this case, is to reset the hardware. This setting can be seen on the "Expiration Actions".
Requirements
Software
Hardware
Steps to Implement or Execute Code
Additional Information or References
**The code for this example has been edited to meet the new Community Example Style Guidelines. The edited copy is marked with the text ‘NIVerified’. Read here for more information about the new Example Guidelines and Community Platform.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.