Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NIDAQmx: "multithreading" - reading from multiple device input channels in parallel (NI USB 9229)

Solved!
Go to solution
Hello all,

I am using NIDAQmx 9.0.2 (C++, Windows XP) and I need to read data from multiple channels of a NI USB 9229 card. My application will receive from another application requests to read samples like in the following example:
- 1: my app is requested to read samples from "Dev/ai0"
- (1 is not finished yet at this point) 2: my app is requested to read samples from "Dev/ai2"
- (1 and 2 are not finished at this point) 3: my app is requested to read samples from "Dev/ai4"
- my app is requested to finish 2
- 1 and 3 are still running at this point
etc...

I was thinking of having a thread for each read request, but as I understand from this forum post this is not an option (?).

Also, the suggestion (in the same post) of using a single task for acquiring data from two channels is not viable for me, since I don't know beforehand which channels I will be required to read from and at which moment.

Is this kind of behaviour possible to implement in NIDAQmx at all? If yes, does someone have an idea how this could be done?
Thank you in advance for any input!
0 Kudos
Message 1 of 3
(3,983 Views)
Solution
Accepted by topic author acgrama

Hello,

 

The NI USB-9229 only has a single timing engine.  As a result, you cannot read from each channel independently.  One possible way to set this up would be to read from all four channels continuously.  Then, when your other application requests samples from a given channel, use software to separate out the samples you want for that channel.

 

Regards,

Seth B.
Principal Test Engineer | National Instruments
Certified LabVIEW Architect
Certified TestStand Architect
0 Kudos
Message 2 of 3
(3,976 Views)
Thank you!
0 Kudos
Message 3 of 3
(3,935 Views)