Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to read 4000 samples from the analog channels of cDAQ module (NI 9205)

Solved!
Go to solution

Please check the bloack diagram (FALSE state of Case Structure has Wait function with 20ms) and attached code (saved in LabVIEW 2015).

Prototype

 

On running the code and using 'Trig' button, I can see only 1000 samples (for each channel) and not 4000 samples.

Please help me understand, what am I doing wrong?

0 Kudos
Message 1 of 7
(4,400 Views)
Solution
Accepted by scofield

Wire "4000" to the "samples per channel" input of the DAQmx Timing VI. The default value when unwired is "1000".

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
Message 2 of 7
(4,383 Views)

Hello Brandon,

 

Thanks for the reply, yesterday I figured this out.

However I'm still trying to understand that, when I've wired 4000 to the 'number of samples per channel' input of 'DAQmx Read' function, why is that not over-riding the default setting of 'DAQmx Timing' function.

0 Kudos
Message 3 of 7
(4,377 Views)

It's not overriding it because the two parameters control different concepts.

 

The DAQmx Timing VI configures the AI timing engine's sample clock. In the case you had originally, with "Finite Samples" and the default "samples per channel", the sample clock will consist of 1000 pulses, which causes 1000 samples to be latched by the device. This configuration is what gets used when you start the task. (This happens implicitly when you call DAQmx Read, but can also happen explicitly if you explicitly call DAQmx Start Task.)

 

Behind the scenes, the DAQmx driver is acquiring those samples from FIFOs on the device and putting them into a buffer. The "number of samples per channel" input on DAQmx Read VI configures the number of samples to read from that buffer.

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
0 Kudos
Message 4 of 7
(4,367 Views)

Hi Brandon, I'm now running into a different issue.

I'm using PXIe-4300 (with TB-4300B), to my understanding, this DAQ card has 8 simultaneous sampling analog input channels.

Now, I've a continuously running task, with first 6 channels configured.

Continuous Task (Ch0-Ch5)

 

Along with this I'm creating another task, which will read 4000 samples on last two channels, based on trigger.

Trigger Based Task (Ch6-Ch7)

Whenever I'm running the second code (while the first code is continuously running). On using 'Trigger', I'm getting error '-50103'. This error is expected in DAQ card with multiplexed ADC but why in a simultaneous sampling card?

How to create two tasks with this DAQ card?

 

Note: For time bieng I'm unmarking this post as 'Solved' so that this post attract more attention.

0 Kudos
Message 5 of 7
(4,302 Views)

"Simultaneous sampling" means that the product has multiple ADCs and they can all latch data at the same time (instead of being scanned). It doesn't refer to the quantity of AI timing engines; the PXIe-4300 only has a single AI timing engine, and therefore only a single device FIFO and clock generator, thus the limit of a single active hardware-timed AI task.

 

Many NI DAQ devices only have a single AI timing engine. A probably-not-exhastive list of exceptions I can think of include multi-slot CompactDAQ chassis (generally three) and a handful of PXIe-43xx and 44xx devices (4339 and 4463/64 have two, 4302/03/04/05 and 4340 have four).

——
Brandon Streiff
ni.com/compactdaq · ni.com/daq
Message 6 of 7
(4,287 Views)

Hey Brandon,

Thanks again.

0 Kudos
Message 7 of 7
(4,278 Views)