LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what's wrong with my distance increaser

I tried to make counter that increase distance, each time i press a button. Distance should increase by a value I give with numeric control(eg.20m) The problem is that I want the loop return Zero(0) by a first press of button and then increase number by a num indicator. Attached vi gives a glue what I mean.

T:Neuvos
0 Kudos
Message 1 of 9
(2,919 Views)
The easiest way to do this is to put your counter in a while loop and use a shift register.
Increment the register by (20m) every time your button is pressed, Zero it every time another button is pressed.
The while loop runs very fast so you may need to use properties node to cancel the button at the begining of the loop or it will cout many times per press!
What version LabView you have?
0 Kudos
Message 2 of 9
(2,919 Views)
I have 7. I can do the loop that increses the value but the problem is that I want a zero out at first round. I am arraying values to graph and a table. I have a button which does other things(saving)at the same press. Values are demonstrating measuring points.
0 Kudos
Message 3 of 9
(2,919 Views)
Dear Neuvos,

pl. find the modified attached vi.

Hope it solves your purpose. Your feedbacks are welcome.

Best regards,
Nirmal
0 Kudos
Message 4 of 9
(2,919 Views)
output should be like that 0,20,40,60,75,85,10.....

Depending on which is the given value between points
0 Kudos
Message 5 of 9
(2,919 Views)
Thanks Nirmal!!!!!

Your vi was allmost exactly what I needed. Only thing I had to change was the Distance inside the so that I can change the distance between measurements.

And thanks again.

BR Neuvos
0 Kudos
Message 6 of 9
(2,919 Views)
Good solution nirmal.
If you want to take out the time delay of 500ms, you can put your increment button on a shift register.
Compare the register with the button and only increment when they are different.
I changed the OK button to switch when pressed.
0 Kudos
Message 7 of 9
(2,919 Views)
Dear Dand, thanx.

As per the original question, distance must only increase in case switch is pressed from OFF to ON.

In your vi, as you have kept the action of button as "Switch when pressed", it increments the counts even if i make the button on to off.

By the way, thanx again. Your feedbacks are welcome.

Nirmal
0 Kudos
Message 8 of 9
(2,919 Views)
Nirmals suggestion serves my needs best. It works like I want 'one count by one press'.

BR,
Neuvos
0 Kudos
Message 9 of 9
(2,919 Views)