LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to store value of a counter

Hi I'm working on a project where I would like a motor to turn a specific amount. At the moment i have a pulse counter which indicates the amount of pulses the motor has received(n), and therefore the amount of rotation/distance. I would like to input a desired number of counts(k) and make the motor turn according to the input.

What is the best way to go about doing this?

Personally i would like to add a desired amount of counts(k) to the current value of the counter(n),  then moving the motor until the counter reaches the desired value of n+k. However I'm having trouble implementing this method as when i move the motor, the counter value changes (n'), so the desired value also changes to n'+k (essentially always off by a constant(k)). I need a way of storing the value of the motor counter(n) so that i can compare n' to n+k

I hope this makes sense...

Thanks in advance

 

0 Kudos
Message 1 of 4
(3,012 Views)

Hi thsskk,

 

to store values in one iteration of a loop to use them in a later iterations you usually use shift registers…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(2,996 Views)

Thanks for the reply!

Im pretty new to LabView and i dont fully understand the shift registers (at least for my context). I understand that it can iterate from a previous value, but im not sure how i would go about storing the desired value to compare later. Can the same value be used for all the iterations?

Any helpful links or examples related to the context will be appreciated thanks

 

0 Kudos
Message 3 of 4
(2,983 Views)

@hhsskk wrote:

i dont fully understand the shift registers (at least for my context).


http://www.ni.com/video/3235/en/

0 Kudos
Message 4 of 4
(2,975 Views)