10-23-2009 03:59 AM
Hi,
I'd like to acquire data from an instrument with a 6024E board and then fit the peaks and repeat that at the highest possible frequency. The DAQ task is configured for finite sampling using a trigger signal generated by the instrument (55Hz). When I use a VI such as demo_v1 (see below) everything works fine but it takes around 200ms just for the DAQmx read VI to execute.
It seems that starting the task outside the loop (see demo_v2) helps to reduce acquisition time but it does not work anymore with finite sampling. If I configure the task for continuous sampling the synchronization with the instrument trigger is lost.
How can I overcome this problem?
Bernard
Solved! Go to Solution.
10-23-2009 04:20 AM
You can reserve the task before the while loop.
Also put the data handling in a separate loop and send the data with a queue to that loop.
Ton
10-23-2009 04:58 AM
Hey,
You wrote: "The DAQ task is configured for finite sampling using a trigger signal generated by the instrument (55Hz). "
By "trigger" you mean that your Task runs with an external sample clock of 55Hz?
In general, why don't you use continous sampling and read 100 samples with every iteration of the loop?
Christian
10-23-2009 05:18 AM
No, actually the task runs with an internal sample clock of 18kHz to measure a signal which is generated by the instrument every 18ms (55Hz). If I use continuous sampling it will not be synchronized with the instrument.
I'll try to reserve the task as Ton suggested and keep you informed on the progress.
Bernard
10-23-2009 05:30 AM
Ok, thanks for the clarification.
Another hint would be to use retriggerable AI, which means you combine a Counter Task - which is retriggerable - to generate a sample clock for your AI Acquisition. E.g. everytime a trigger arrives from your instrument you take exactly 100 samples with the Clock generated by the Counter Task.
Christian
10-23-2009 09:15 AM
Hey,
Not sure to understand exactly how to reserve the task. I tried something like that (see below) but it didn't change much. I also tried to implement the queuing. Is this what you meant?
Thanks,
Bernard
10-23-2009 09:49 AM
Thanks Christian for the suggestion. If I understood well, you suggest to create a second task for the same board? As far as I know one can't do that with the kind of DAQ boards I have (PCI-6024E). Do you have an example?
Bernard
10-23-2009 10:10 AM - edited 10-23-2009 10:12 AM
sorry edited out
10-27-2009 02:50 AM
Have a look here, in the LabVIEW examples (Help->Find Examples) do a search for retriggerable. The 6024E is explicitly named.
Ton
10-27-2009 03:32 AM
Bernard,
You said: "... you suggest to create a second task for the same board? As far as I know one can't do that with the kind of DAQ boards ....."
You can create different Tasks for AI, AO, DIO and Counter, but you cannot create more then one AI Task running at the same time (one timing source, multiplexer, ...).
Just have a look at the example suggested by Ton, then you will see it's a Counter Task generating the timebase for your AI Task.
Christian