LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I read a GPCTR and analog channels similtaneously with LabView V5

I want to sample 8 analog channels and one GPCTR channel in the same scan. The GPCTR is connected to a linear encoder measuring a moving assembly. It is important that the counter value is sampled at virtually the same time as the analog signals are sampled. So far, I have seperate VI's that read the analog signals then the GPCTR. The AI Read VI takes 1000 samples then the GPCTR is read. This means that the counter is read 1 second after the AI is read and therefore not at the same time. How can I change this?
0 Kudos
Message 1 of 3
(2,472 Views)
GR,

There is such a thing as buffered counter acquisition. It works very similar to buffered analog acquisition; the only difference is that it can't be used as a circular buffer (continuous acquisition). To start both your acquisitions (analog and counter) at the same time, you'll have to set up a trigger.

To do this, you can set both acquisitions to start from the same trigger line. Then you either have to trigger the line from an external source, or do what most of us do and use LabVIEW to trigger a counter, DIO, or some line that can be fed in as the trigger. This will synch the two acquisitions. Then, once you get all the data, combine both data into one array (assuming they have the same scans/sec).

Mark
0 Kudos
Message 2 of 3
(2,472 Views)
GR;

The best way to do that is by setting up a buffered counter acquisition and synchronize that acquisition with the Analog operation. A good application Note you can refer to get familiar on how to synchronize multiple DAQ operations is named: "Advanced Synchronization Techniques for Data Acquisition" and can be found at our website: www.ni.com
Hope this helps.
Filipe
Applications Engineer
National Instruments
0 Kudos
Message 3 of 3
(2,472 Views)