LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simple addition problem

I am facing a problem with simple addition.
 
I have a number, say 100. Now, I want to add 0.001 to it by pressing a push button.
For example, if I press the push button once and leave, the output number should now be 100.001. On the next press and leave, it should become 100.002 and so on.... Please help me out with this. Thanks
 
Regards,
Cruiser Controls,
Mumbai, India
0 Kudos
Message 1 of 5
(2,799 Views)
That's easily done with a shift register and a while loop. I've attached a program (LV 7.1) that uses the event structure but could just as easily be done with just a case statement. Shift registers are basic elements of LabVIEW programming. Look at the shipping examples.
Message 2 of 5
(2,793 Views)
Here's one simple way to do this using the event structure.  I have used a timeout event, but you could replace this with a stop button event.  There may be other approaches depending upon what else you are doing in the program.
0 Kudos
Message 3 of 5
(2,794 Views)
It's good to see that my approach is the same as that of the great Dennis Knutson!
0 Kudos
Message 4 of 5
(2,787 Views)

Thanks a lot Mr.John and Mr.Dennis. That was exactly what I needed.

We'll keep in touch.

Bye

Regards,

Giridhar Rajan

Cruiser Controls

Mumbai, India

0 Kudos
Message 5 of 5
(2,765 Views)