Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PXI synchronize quadrature encoder with 2 analog inputs

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

0 Kudos
Message 1 of 5
(3,654 Views)

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....

 

Download All
0 Kudos
Message 2 of 5
(3,650 Views)

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

0 Kudos
Message 3 of 5
(3,636 Views)

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

0 Kudos
Message 4 of 5
(3,625 Views)

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

 

 

Message 5 of 5
(3,611 Views)