03-14-2001 08:22 AM
03-16-2001 12:01 PM
08-25-2006 05:13 AM
Hi all !
I also have a problem,
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 !
08-28-2006 02:20 PM
Hello,
Unfortunately, I do not see a way around this situation. Why do you need to read the samples right away? The only way I see to do this is to increase the sample rate so you get those first samples faster and then throw away the extra data you do not need.
Regards,
Laura
08-29-2006 12:49 AM
Hi Laura, and thanks for your answer !
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 configure di n max... If i have no sample , i generate an error message, and i stop the acquisition. The problem is if i hav 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 also 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, but it's good to know how it's work!!!
Thanks again for your answer !
08-29-2006 07:20 AM