Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx AI read minimum number of samples

Hello all,

I'm reading an analogue input voltage in a while loop. I configured a sample clock (source = RTSI0 / mode = continuous samples) and a start trigger (digital edge). I have a problem When the sample rate on RTSI0 is very low and measure less than 2 samples each iteration. I can only read the buffer if it contains 2 samples! I'm missing the last sample when I generate an uneven number of samples (excluding the first trigger to start the task). How can I make sure I read all samples?

Thanks,

Jos

LabView 7.1
PCI-6220 card
0 Kudos
Message 1 of 3
(3,084 Views)
Hi,
 
It looks like the driver optimized read out when you use the -1 as number of samples to read. When you ask for a fixed number of sample for example 3 then you will get 3 samples.
 
I'll look into this a bit further. If i find more information I'll update this thread.
 
Kind regards,
 
Karsten
0 Kudos
Message 2 of 3
(3,038 Views)

Hi,

What is going on here is that in the DAQmx driver does 32bits transfers, this means that for 12 or 16 bit boards there will fit 2 samples in 32 bit. that is the reason why you always get a even number of samples. To get all samples per iteration you will have to use a second read function for 1 sample with a very low timeout. This will enable you to read the last sample in the buffer is there is one. you will get a timeout when there are none.
 
Hope this helps
 
Karsten
NI
0 Kudos
Message 3 of 3
(3,023 Views)