LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increase Decrease (again)

Hi!

Earlier I got some great help with my program. I'm using a quadrature encoder to measure a motors rotation velocity. Since I couln't get anything else to work, I'm sampling the inputs from the rotary encoder with analog inputs, wich seems to work fine. I get one LED to lit when the motor runs in one direction, and anotherone to lit when the motor is rotating the different way. Now I just need to count the pulses: +1 for each time pulse in one direction, and -1 for each pulse the other way.

I believe that the problem explains itself the best in my attached VI. Hope anyone can be helpful with my big (but simple I guess) problem 🙂
0 Kudos
Message 1 of 5
(2,846 Views)
Hi Kristoffer,

use one more shift register... And cleanup your code Smiley Wink


Message Edited by GerdW on 04-15-2008 08:46 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(2,841 Views)
Tanks 🙂

Unfortunately, this doesn't solve the problem. Problem now is that the program adds one number  w h i l e  the pulse is high. If the pulse is long enough the program can add for instance 50 numbers pr pulse. Each time I've got an incoming pulse, I just need ONE increment /decrement.

But thanks a lot for your time, and thank you for your tups on cleaning up my code. Of course you've already understood that I'm a really rookie to LabView 🙂
0 Kudos
Message 3 of 5
(2,838 Views)
Hi Kristoffer,

you didn't mention before that you only want to count rising edges...

See attachment! (I'm sure the boolean calculations can be simplified even more now...)
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(2,821 Views)
I guess I didn't write that, sorry about that.

And thanks a lot! You really saved the day! Now, as soon as I find out how to rate a good answer I'll give you an A+

THANKS 😄
0 Kudos
Message 5 of 5
(2,819 Views)