LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Increase Decrease number.... (simple question I guess)

Hi.

I guess I have a really basic newbe question, but I just can't find any good examples on the net, even though I'm sure there are tons of them.

In order to get a more complex system to work, I have two boolean inputs. If one of the two boolean inputs is true, a number should increase. If the other boolean input is true, the number should decrease.

This is the entire problem. I've attached my project, and hope that someone with more experience than me will give me some helping tips. I would really appreciate it.

-The one thing that I've managed to make is a number being increased when when a button is pressed, and another number to decrease when the other button is pressed. And then the final number can be calculated by adding thw two numbers. Problem is that I use three variables instead of just the one, and there has to be a more celicate solution. Also, with this solution the numbers will increase and increase neverending, so after some while I expect the system to crash because the numbers get too big. We've also made a program that resets these numbers before they get too big, and this actually works, but still we can't help thinking that we've made a solution much more complex than we really need.

Thank you very much for hints 🙂
0 Kudos
Message 1 of 8
(2,905 Views)

Hi Kristoffer,

try this.

Mike

0 Kudos
Message 2 of 8
(2,902 Views)
Hai Mike,
 
Ur example works nice. But when we stop and run the example again obviously it shoud indicate 0 at starting point and depending upon key press it should increase\decrease accordingly. But the example didn't display 0 at starting of runtime. Rather the previous value was maintained. Any means to work around this?
 
Mathan
0 Kudos
Message 3 of 8
(2,894 Views)
Hi,
you can use it in this way. Another way is to save the value at the end into a file and load it at the beginning.
Mike


Message Edited by MikeS81 on 04-07-2008 01:00 PM
0 Kudos
Message 4 of 8
(2,888 Views)
Hai mike,
 
Thanks. Still one query. How to reset the numeric indicator to read zero at the start of runtime. One way is to initialize the indicator to a zero constant value outside the while loop. Any more suggestions?
 
Thanks,
Mathan
0 Kudos
Message 5 of 8
(2,882 Views)

Hi mathan,

i´m not sure what you mean, but here is a solution without using a property node.

Mike

Message 6 of 8
(2,879 Views)
Great 🙂

Thanks a lot, really appreciate it!!
0 Kudos
Message 7 of 8
(2,871 Views)

Hai mike,

That's what i expected. Great work.



i´m not sure what you mean, but here is a solution without using a property node.

Mike



Am sure u have very well understand my question,Smiley Mad  that's why gave the correct and required response.Smiley Very Happy Smiley Wink
 
Anyway here i gave u 5 stars.
 
Mathan
0 Kudos
Message 8 of 8
(2,870 Views)