Monitoring Programmatically My CompactDAQ and Computer Connection

Updated Oct 27, 2023

Environment

Hardware

  • CompactDAQ Chassis
  • Ethernet Device

Software

  • LabVIEW

I have an application working with an ethernet CompactDAQ (cDAQ), and I would like monitor programmatically the connection health between the cDAQ and the computer.

There are some alternatives that can be implemented to monitor programmatically the connection health between an ethernet cDAQ and a computer. Here are some options:
  1. Use the Error Cluster: If during the data acquisition process the cDAQ loses connection, then any function that tries to access the cDAQ address will output an error. In this way, this can be used to check if there is any error taking place in the communication. If during the excecution of the following code the connection is lost a timeout error Error -200284 will take place.                                                                                                                        
  2. Programmatically ping the cDAQ: The command prompt can be called using LabVIEW, then the connection between the cDAQ and the computer can be checked using the ping command. The major advantage of this technique is that the monitoring process can be done at any moment without necessarily performing a data acquisition task.                                                                                                                                                                                                                    

Additional Information

If you want your cDAQ device to perform an operation due to the connection lost it is possible to implement a Watchdog Timer. This Watchdog Timer functionality can be added to the main program using the Watchdog timer API of DAQmx, and it will react to the disconnection in a hardware time basis.  

If we just want to check that the device is connected without using the programmatic way, we can always check if the device is present using NI-MAX.