From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Managing Tasks on Ethernet cDAQ - Best Practice

Hi all,

 

I'm currently working on a multi-station machine to perform functional product tests using an NI cDAQ 9188. Each station in the machine performs the same function but is intended to run independently. Basically a given station is loaded with a part, tested, sorted, a new part is installed and repeats. During this process other stations are undergoing the same procedure and sharing the same cDAQ. 

 

During this testing digital signals (48) are turned on/off and analog signals (24) are being read between all stations. I've found that in contrary to a PCI task, the ethernet cDAQ tasks have quite a delay (~750 ms) when starting / stopping. Prior to this project I've only had experience using PCI tasks where I could read N Samples when needed without much start-up delay. Same goes for writing digital samples.

 

The solution I've implemented for this is to create a continuous analog read VI that reads all analog signals and loops in the background continuously writing to a global variable. When a given station gets to a point where it needs to read signals, it pulls the desired index from the global array at that point in time. I also have a similar solution set up for the digital task, except it is reading a global variable for digital states and applies that to the task on each loop iteration. Normally I try to avoid continous loop senarios but the PC I'm using lets me get away with it. 

 

Basically what I really need is subVI that starts the analog or digital task, but is idle until called by any module and returns N samples. This VI needs to act as a gate for analog read requests to avoid any reserved resource issue. I can't really think of how to accomplish this. 

 

Any ideas?

0 Kudos
Message 1 of 2
(3,834 Views)

If you're looking for more control over the DAQmx task, perhaps you could utilize the DAQmx Control Task VI to control which state the task is in?

 

http://digital.ni.com/public.nsf/allkb/3D9CF4F4A0549F40862574420029ECCD

http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/

Michael Keane
National Instruments
0 Kudos
Message 2 of 2
(3,806 Views)