Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

Programatically check when cDAQ is ready after reserve



I am trying to connect and disconnect a NI9188 cDAQ programmatically, I start by adding the device with "DAQmx Add Network" followed by reserving it with "DAQmx Reserve Network"

After the reservation I would like to spawn a few tasks on the chassis modules but this give me an error since the chassis has not yet descovered all its modules. 

Adding a 10-15 second delay before creating the tasks removes this problem, but since this delay can very base on network I would like to find a better way to identify if the chassis is ready for use. 


How do I veryfy programatically that all my modules have been added to the chassis and are ready for useage ? 


I search on google and in this forum for a few hours without any luck and also tried several workaround like checking module types in a loop until all have been registered and running selftest on every module. Yet nothing seems stable so far and I am wondering what the correct way of doing it is. 

0 Kudos
Message 1 of 5

You can try adding a DAQmx Device property node set to Chassis.ModuleDevNames and pole the names array until your device is found (or a timeout that you implement) occur.



0 Kudos
Message 2 of 5

Hey Ben64, thanks for the repply


This is one of the workaround I allready tried, the loop waiting for the modules names. It takes about 8 seconds before all are registered, but even though I can get the module names and types if I create a task right after this loop I will get in error on the last to modules not being avalible. 


If I wait 3 seconds after this loop the task are created whitout any problems. It seem to me that they are not fully initialized when they are capable of sending out name and type information. 

0 Kudos
Message 3 of 5

Here is how the VI was connected in that test 

0 Kudos
Message 4 of 5

Good question. Unfortunately, not a satisfactory answer yet.

Basically I do the same as _Deks_ describes. Up to now, temperature readings are available once I polled for the Chassis.ModuleDevNames to exist.

I wonder how others distribute their executables? I you use static ModuleDevNames, then it won't work anymore as soon as your customer replaces the cDAQ chassis. It seems to me that it would also be difficult to update software for your customer, if you don't have your PC connected to the customer's hardware.

0 Kudos
Message 5 of 5