LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI DAQmx Python API cannot set Watchdog Network Loss Trigger

I've been attempting to debug some odd behaviour I've noticed with my cDAQ-9189 board with regards to the watchdog module functioning poorly in the case of a network disconnect (when the network connection between the board and the computer running the software is killed, in my case by pulling out an ethernet cable). I have found through my readings that the cDAQ-9189 is ostensibly able to trigger the watchdog on detection of such a network loss, although in practice it only seems to work two times in every three.

 

Relevant information:

DAQ:

  • Two cDAQ-9189 boards networked in a line formation

Software:

 

I am trying to set/access the watchdog task's expir_trig_trig_on_network_conn_loss flag, which is stored as a bool and specifies whether or not the task triggers on network loss. However, when I run this code

 

     import nidaqmx

     

     watchdog_task = nidaqmx.system.watchdog.WatchdogTask('cDaq9189-1E620C4',timeout = -1)
     watchdog_task2 = nidaqmx.system.watchdog.WatchdogTask('cDaq9189-1F1F32F',timeout = -1)

     watchdog_task.expir_trig_trig_on_network_conn_loss = True

 

I get this error:

 

Traceback (most recent call last):
File "C:\Python38\lib\site-packages\nidaqmx\_lib.py", line 139, in __getattr__
       cfunc = getattr(self._library, function)
File "C:\Python38\lib\ctypes\__init__.py", line 386, in __getattr__
       func = self.__getitem__(name)
File "C:\Python38\lib\ctypes\__init__.py", line 391, in __getitem__
       func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'DAQmxSetWatchdogExpirTrigOnNetworkConnLoss' not found

Followed by

 

nidaqmx._lib.DaqFunctionNotSupportedError: The NI-DAQmx function "DAQmxSetWatchdogExpirTrigOnNetworkConnLoss" is not supported in this version of NI-DAQmx. Visit ni.com/downloads to upgrade your version of NI-DAQmx.

 

I have tried this with both 19.6 and 20.1 as stated above, so it's unclear to me which version of DAQmx supports this functionality. Would anyone be able to shed some light on this? Is there a particular version of DAQmx I need to upgrade/revert to in order to use this functionality?

0 Kudos
Message 1 of 2
(831 Views)

A quick cursory search for that attribute (expir_trig_trig_on_network_conn_loss) in the source for nidaqmx-python and it appears that support was added here.

0 Kudos
Message 2 of 2
(558 Views)