07-27-2016 08:00 AM
@GerdW wrote:Hi Ambrose,
did you read the Wikipedia article I linked above? Did you understand the part explaining AB/Quadrature encoders with rotary encoders as example?
You need to get the current state of A and B and compare them with their previous state. The tables show you the possible combinations and their meaning (forward/backward movement).
Comparing boolean signals is easy - as shown above. Comparing numeric values is also easy using simple comparision functions!
Here is my vi. I tested already. but the counter din get correct way. If in A lead B mode every rising edge of channel A the counter will count up and if B lead A mode every falling edge of the channel A counter will count down. I testing so many time i still cant get it.
07-27-2016 08:11 AM
Right now I'm limited to LV2014. Can you attach a downconverted version of your VI?
If in A lead B mode every rising edge of channel A the counter will count up and if B lead A mode every falling edge of the channel A counter will count down.
You need to attack the problem from the other side (as shown on Wikipedia): you check the current state of A and B and compare with their previous states to decide between "A leads B" or "B leads A" (count up/down)!
07-27-2016 08:34 AM
@GerdW wrote:Right now I'm limited to LV2014. Can you attach a downconverted version of your VI?
If in A lead B mode every rising edge of channel A the counter will count up and if B lead A mode every falling edge of the channel A counter will count down.
You need to attack the problem from the other side (as shown on Wikipedia): you check the current state of A and B and compare with their previous states to decide between "A leads B" or "B leads A" (count up/down)!
Here the vi i downconverted to Labview 2014. Thank you so much.
07-27-2016 09:04 AM - edited 07-27-2016 09:05 AM
07-27-2016 09:16 AM
@GerdW wrote:Hi Ambrose,
see this:
I still confusing what you mean PI=3 and CI=2 then count down??? the control a and b is it same as my vi after first case structure output a and b?
07-27-2016 10:30 AM
@GerdW wrote:Hi Ambrose,
see this:
Hi GerdW, Thank you so much for your helping a lot. Finally I understand what you say PI=3 and CI=2. I get the result I want d. I'm appreciated it.
07-28-2016 02:10 AM
How i going to compare the A lead B and B lead A ? If A lead B will go to rising edge case then counter count up and B lead A will go to falling edge case then counter count down. Here is my vi below. Once I build thealgorithm the counter will count up and down together.
07-28-2016 02:27 AM
Hi Ambrose,
yesterday you got the result, today you ask again?
And why did you create a new thread on the same topic? Please stick with one thread per problem…
You don't need to check for rising/falling edges. All you need to compare is state of AB with their previous state!
07-28-2016 03:19 AM
According my vi, i directly make it true or false (mode control) statement for comparison, i found that did not compare the signal A and B by itself. That why I ask again.
07-28-2016 03:29 AM