From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linear Encoder, Counting Ticks

To all,

 

I have the VI created for the linear encoder and everything works fine, except when it comes to counting ticks.  When the encoder moves in the positive direction from initial position, the ticks are counted correctly, but when I move the encoder in the negative direction from the initial position, the encoder immediately reads "4.29E+9".  It continually reads this value moving backwards, and will not accurately measure position until the encoder has been moved an equal distance forward, back to its initial position, then it counts forward correctly.  Any speculation as to why it reads this number?  Any suggestions for fixing?

 

Thanks,

Owen

0 Kudos
Message 1 of 4
(3,281 Views)
Replace your U32 indicator by an I32.
0 Kudos
Message 2 of 4
(3,253 Views)
Tried that, didn't work.  The representation was already type double; I changed it to all other data representations and it still did not work.
0 Kudos
Message 3 of 4
(3,214 Views)

Could you please make a trial with an example from NI ?

 

LV Menu >> Help >> Find Examples... >> Hardware Input and Output >> DAQmx >> Counter Measurements >> Position >> Measure Angular Position.vi

 

You can easily adapt it for a linear encoder but even the original version will allow you to check your setup. Please read the NI-DAQmx help for the default terminals for your DAQ card.

0 Kudos
Message 4 of 4
(3,199 Views)