10-01-2007 04:20 AM
10-01-2007 05:03 AM
Hey J,
It would be very helpfull to know which hardware you are using.
However, you can take a constant pulsed signal (e.g. internal timebase) for both counters as source signal. Then you configure both counters for buffered edge counting and use the two lines of the quadrature encoder als trigger signals. So every time you getting an edge of your quadratur endcoder you get the value of pulses from the source signal. So you can calculate the phase shift beetween this signals out of the counted edges between both counters.
Hope this helps, Christian
10-01-2007 05:11 AM
10-01-2007 06:46 AM
Hey J,
Just look for the "Count Digital Events - Pause Trigger example".
There you can use as source signal for the counter the internal 20MHz timebase and the signal from your quadrature encoder to trigger the counting. So e.g. every time the trigger is high the counter value increases.
BR, Christian
10-01-2007 09:24 AM
10-02-2007 03:49 PM
Hello J,
Thanks for contacting National Instruments.
As Clint mentioned in your other post, the easiest option would be to use the pulse measurement VIs referenced in this knowledge base. This option has the encoder pulses read in as analog inputs and the pulse measurement VIs are used to determine phase separation.
Another option would be to use a two edge two signal separation measurement with a counter task. This type of task uses a triggering and a counter to find the number of ticks of a specified timebase between the specified edges of two different signals. Page 7-18 of the M Series DAQ Manual shows a timing diagram of this type of measurement.
This task can be created in Measurement and Automation Explorer by creating a new DAQmx Task and then choosing two edge separation under counter input. The configuration window indicates required PFI lines that the encoder signals should be connected to and also allows you to set the edge type for both signals. The Meas Two Edge Separation-Buffered-Continuous in the example finder for LabVIEW will acquire edge separation data continuously. This will give you the amount of time between encoder output pulses. From there you can use the encoder frequency to determine the phase delay between encoder outputs.
Please post back if you have any further questions.