01-07-2013 06:36 AM
I am developing an application in which I need to acquire a qudrature encoder and 2 analog input. The refesh frequency is set to 1 kHz.
I am running on labview RT on a PXIe-1071 with PXIe-8102RT controller- The DAQ board is a PXIe-6341.
I have configured two loops (so that they run in parallel), one doing the acuqisition, the other doing some elaborations on the sample.
I tired to use the express DAQmx with a single point acquisition, timed by a timed loop, but i'm having long conversion time (around 500 us) an i sometimes see that the timed loop takes up to 5 s to complete an interation (even setting a 900 us deadline on the loop).
I checked it with Execution trace toolkit.
So i guess my approach is totally unreliable.
Is there a way to write a code that ensure that the acqusition time is around 0,1 ms? i can tolerate some jitter on the 1 KHz frequency, but i cannot have missed acuisition, since this would screw up the fitering that i'm doing in parallel with the acqusition.
thanks
Paolo
01-07-2013 09:40 AM
To better explain the problem that i'm havig, i'm attaching a VI.
The problem is that it is totally unrealible: sometimes it works for 1 minute, sometimes for just 2 seconds because
one of the two acquisition tasks goes into timeout (which is now set at 1 second).
What should i change to make the code more reliable? In its final versions, it should run continuously 24/7....
01-08-2013 10:32 AM
Hi,
First at all, you cannot use both Timed Loop and Wait For Next Sample Clock VI in order to set the Cycle Time so you have to choose one of these options. After that if you want to syncronize Counter Input and Analog Input Task I would like to suggest you to change Timing Configuration. You could use Sample Clock and "Continuous Sample" modality as well; you should use the same clock source for both tasks. In the end you should syncronize the Start Task VIs through Error Cluster to avoid any issue. Good luck!
enpe
01-09-2013 05:37 AM
Thanks enpe, this solved the problem.
Another question: do you think it is a good idea to write the aquired samples on a local variable,
and reading-processing them in another timed loop that runs at 1 kHz?
cheers
paolo
01-10-2013 02:48 AM
Hi Paolo,
It's a good idea separate Acquisition Loop from Processing Loop but you should use Queues instead of local variables improving your performance. You can find some VIs into Labview "Find Examples" in the following section:
Foundamentals->Optimizing Applications->Syncronizing Tasks.
Have a good day!
Regards,
enpe