Example Code

Reset cRIO using Watchdog Timer

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.


  • CompactRIO|SingleBoardRIO


  • LabVIEW Real-Time Module
  • LabVIEW


  • NI RIO

Code and Documents


Download All

This example demonstrates how to use a Watchdog Timer to reboot a cRIO if the system became unresponsible.



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".




  • LabVIEW Full Development System 2012 (or compatible)
  • LabVIEW Real-Time Module 2012 (or compatible)


  • compactRIO (cRIO)


Steps to Implement or Execute Code

  1. Download and open the attached ZIP-file
  2. Open the VI inside the LabVIEW project and follow the instructions on the Front Panel


Additional Information or References

cRIO Watchdog - Front Panel.png


cRIO Watchdog - Block Diagram.png


**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.**
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Ben Sisney
FlexRIO V&V Engineer
National Instruments
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.