LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to clock measurements based on encoder state change?

We need to make analog measurement at each encoder state change. Tried the attached VI, but no signal appears on PI0. PI0 is wired to PI1 which should clock the AI.
 
The examples we saw either use just A or B to clock at 1/4 resolution or allow reading position at any given time, but nothing to clock based on encoder position change.
 
We took the example app for reading encoder with quadrature and tried adding the MX stuff to get AI on encoder state changes.
 
Thanks for your help.
 
--James and Roger
0 Kudos
Message 1 of 5
(2,830 Views)

Hello James and Roger,

What do you mean by "encoder state change?"  If you just mean a change in position, then you should use either the A or B lines of your encoder to clock your analog input (AI).  The Counter Output Event signal only pulses (or toggles) when the counter reaches its terminal count.

If you just want to take an AI sample with every click of the encoder, you will need to physically route the A or B encoder line to a PFI line, and use that PFI line as the source for your AI Sample Clock.

I hope this helps.  Please let me know if you have any further questions.

Regards,
Sean C.

0 Kudos
Message 2 of 5
(2,804 Views)
We want to take an analog reading everytime A or B changes state. If we clock on the leading edge of either the A or B signal alone, we only get 1/4 the resolution the encoder can provide.
0 Kudos
Message 3 of 5
(2,801 Views)
There is no way with your hardware to acquire an analog sample for every rising and falling edge of the A and B lines of your encoder.  You could set up a retriggerable analog input (AI) which acquires 4 points for every rising edge of the A line, but each AI sample wouldn't necessarily correspond to a change in state of the A or B line.
 
If you want to take an analog reading every time A or B changes state, you will need some sort of external circuitry which will output a pulse on all rising and falling edges of the A and B encoder lines.  Then use that pulse as the AI Sample clock for your acquisition.
 
I hope this helps.  Please let me know if you have any further questions.
 
Regards,
Sean C.
0 Kudos
Message 4 of 5
(2,788 Views)

Thanks Sean, that answers our question. We'll go with the external circuitry idea.

--James & Roger

0 Kudos
Message 5 of 5
(2,785 Views)