The Watchdog timer is implemented in the same manner any NI-DAQmx task is created. First, you create a Watchdog timer task by using the DAQmx Create Watchdog Timer Task VI. With this VI, you configure the reference to your device and the length of the time-out for the timer.
After you have created the task, you can configure it using the DAQmx Configure Watchdog Expiration States VI. With this polymorphic VI, you can configure the expiration states of the output channels you are watching with the Watchdog timer. For digital output, you can choose to have the channel write high or low or enter into the tristate mode when the timer expires. With the Watchdog timer task for the cDAQ-9185/9189, you can also configure analog and counter outputs. For analog output, you can select if it is a current or voltage task and then set which value you want the channel to write when the timer expires. For the counter output channels, you can configure if you want the channel to write high or low or stay the same when the timer expires. Another tool for configuring the Watchdog task is the DAQmx Watchdog property node. This lets you configure all expiration states, set the time-out value, and enable/disable the option for the cDAQ-9185/9189 where you can trigger the expiration of the timer through a network connection loss.
After the task is configured, it then needs to be started using the DAQmx Start VI. When the Watchdog task starts, it constantly looks for the confirmation that the computer is still functioning properly. To tell the task the computer is properly working, the DAQmx call, DAQmx Control Watchdog Task VI, is used to reset the timer before the configured time-out value. Figure 4 shows an example of a Watchdog task being used for the cDAQ-9185/9189. In this example, a Watchdog task is set up for the cDAQ-9185/9189 and has an analog output channel configured for the channel to enter the safe-state if the timer enters the expiration state or if the chassis is disconnected from the network.
Figure 4. The Watchdog task has an analog channel configured in the cDAQ-9185/9189.
If the timer goes out and the channels enter their safe-states, the expiration must be cleared for the device to become responsive to hardware commands again. Clear the expiration through the DAQmx Control Watchdog Task VI as seen in Figure 5 or reset the hardware device. If you are using the cDAQ-9185/9189, the watchdog timer expiration can only be cleared by resetting the hardware device.
Figure 5. Clear the expiration with the DAQmx Control Watchdog Task VI.
The Watchdog timer can provide a fail-safe mechanism or redundancy in the event of unexpected failure of a system component in your application. With the Watchdog timer, you can set the outputs of a device into known safe-states in the event of a system fault or failure. Using X Series multifunction DAQ cards or industrial DIO products, you can set a Watchdog timer on the digital output channels. For the cDAQ-9185/9189, the Watchdog timer can be set on the digital, analog (voltage or current), or counter outputs and also monitor the network connection and enable the safe-states if connection is loss.