Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

AI buffer read

Hi all !

I create differents ai task to read continuous sample from differents cards. These tasks are created to start with an external  trigger, and are all synchronized together with an external 10 MHz Clock . I may have a different frequencies for each board, these frequencies can go from 0.1 to 20000 kHz. My problem is the following: Immédiately after i generate the trigger, i want to read the samples available on each card in order to know if they are working properly.

It works good with high frequencies (i.e. 10 000 Hz ..) but when i use low frequency 0.1 Hz, i have no sample available, i only have sample after 10 seconds. I tought, that when i start the task, i immedialtly have one sample and i have the second after 10 s... But the test i made show me i have no sample during 10 seconds and then 2 samples . It seems, the sample is present in the buffer of the card, but this buffer is only transfered to the memory after the next cycle ....

I tried to modify the transfert property but there is no change ....      

Thanks in advance for your future help !

0 Kudos
Message 1 of 3
(3,264 Views)
Hi,
 
Could you tell us wich environment you are using? LabWindows CVI or LabView?
 
And, by the way, could you post here your vi / code?
 
Thanks,
BRAUD Jean-Philippe
Field Sales Engineer - Nord et Centre France
LabVIEW Certified Developper
0 Kudos
Message 2 of 3
(3,247 Views)

Hi JP !

I use Labview 8.0 and DAQmx 8.1.

When i start the acquisition, i read one sample of each channel in order to know if the acquisition is working properly, i.e. the boards are not out of order, and the trigger lines are properly configured in max... If i have no sample , i generate an error message, and i stop the acquisition. The problem is if i have a frequencie of 0.1 Hz for one channel and 10 000 Hz for another one. I can wait 10 second to read the first sample, otherwise i will have an overflow in the buffer of the board wich contain a channel of 10 000 Hz ....

I contacted NI support, and they gave me this explanation : If you use DMA transfert between the onboard memory of the card and the PC, the driver can only transfert 32 bits data. And one sample is 16 bits, therefore, you need to acquire two samples before they become available with the read function.  So if you want to read one channel at 0.1Hz, you will have to wait 10 seconds to read 2 samples ! If you use IRQ transfert you will not have the problem (but it reduces a lot the performance of the acquisition) ...

 One solution to avoid this problem is to acquire at least two channels per board, therefore the on board memory will have immediately 32 bits, and the samples will be  immediately available !!! I tested this solution and it works perfectly...

 

0 Kudos
Message 3 of 3
(3,241 Views)