View Full Version : Getting Encoder Position Value
Alright, here's a zinger:
C++[
float elbowencoder = encoder1->Get();
]
This would return a 4x value of it's position, so that I could figure out where it was and what to do with it at that point.
How would I accomplish this in LV?
Thanks.
Me, your local knucklehead.
plnyyanks
21-12-2011, 20:44
In LV, when you open the encoder, you have to specify 4x decoding. Then, you can just read the encoder value as a double. See the attached screenshot.
11227
So distance is what I'll want if I want to know where I am in relation to startup?
So if I'm reading this right, rate will be used for, say, traction control?
plnyyanks
26-12-2011, 21:47
So distance is what I'll want if I want to know where I am in relation to startup?
So if I'm reading this right, rate will be used for, say, traction control?
That is correct. I forgot to mention, that when you open the encoder, one of the inputs to the Encoder Open VI is "Distance Per Count", which is the tangible distance per encoder tick (and I think it also factors into the rate calculation). Make good use of that parameter, and look into the VI documentation for some more information.
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.