LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ in Timed Loop: PXI-6025E too slow for 20KHz?

I need to record 4 channels at 20KHz using a PXI-6025E card in a PXI-1031 realtime target, running labview 8.2. simultaneously, the program has to react in realtime to digital inputs every ms.
so I use one high priority timed loop for data acquisition and one low priority loop for writing data into a file and transferring it to a network published variable, just like the presets and examples for realtime applications.
both loops run at 1KHz and the high priority loop should read 20 samples per iteration. there seems to be no problem with that part, but when i test the system with a 10KHz square pulse signal, there are artefacts in the signal, meaning not every two successive samples are different. testing the setup with slower sine waves, there are sometimes jumps in the signal.
from the specifications of the D/A-card, it should be possible to read 4 channels at 50KHz, I can't see why it doesn't work.
is it that the hardware is too slow, or is is rather a problem of synchronization, or is just the vi attached not correct?
i tried to synchronize the timed loops as in the NI benchmarking examples (http://zone.ni.com/devzone/cda/tut/p/id/5424), but it didn't work, now the loops are using their default clock.
 
thanks a lot in advance for any helpful comment
0 Kudos
Message 1 of 6
(3,391 Views)
Hello Felix,

you have to use hardware single point and a sample clock of 20kHz.
Take a look at the Labview code.

Kind regards,

Elmar
0 Kudos
Message 2 of 6
(3,372 Views)
Thanks a lot for the help. unfortunately i don't have LV8.5 yet. i rebuilt that vi you provided in 8.2.
and in fact i tried that before, but i couldn't find out, how to assure, that all the 20 samples are being read in the specified iteration time of the timed loop. it is crucial that the loop keeps on running at 1KHz, thats why i'm using these timed loops.
but when i read samples at 1 Khz, i have to read 20 samples to have 20KHz analog data. when i do this, i keep on getting error -200714, meaning my hardware is too slow. if i do not specify the number of samples to read, it works, but i decimate the analog inut and not even in a systematic way. so the recorded data is even more corrupted than before.  attached is the version i used using hardwaretimed single point sampling.
 
any suggestions? i'd be grateful for any comments on this.
best wishes,
felix
0 Kudos
Message 3 of 6
(3,364 Views)
Hello Felix,

her the lv example for the 8.2 version.

Kind regards,

elmar
0 Kudos
Message 4 of 6
(3,356 Views)
hello elmar,
 
thanks a lot for your comments and the code. as i said, your example does run without problems on my realtime target.
 
however as soon as i extend it to what i need (two timed loops with a period of  1 ms and the reading of 20 samples) it does not. if i do not specify how many samples to read at the DAQmx Read node, i do not get any sensible output. if i do, i get the above mentioned error. the extended example is attached.
 
i'm sorry for being so persistent but after three different engineers of the NI support hotline could not solve the problem i really start wondering what i'm doing wrong here.
 
i also played around with different timing sources for the timed loops, such that each timed loop cycle waits for the correct amount of samples being available on that task. somehow i didn't work neither.
 
i'd be very happy about any helpful advices.
 
cheers,
felix
0 Kudos
Message 5 of 6
(3,347 Views)
Hello Felix,

if you want to read more than one sample you have to change the read function to Nsamples.
The best way is to use the property node "available samples" so that you get all samples during one interation (look at the attachement).

Kind regards,

Elmar
0 Kudos
Message 6 of 6
(3,342 Views)