03-14-2011 10:40 PM
Hello all, I am trying to use a boolean OK button and a constant to make something similar to the calculator project I've read about in other posts. I labled the button $1.00, $0.25, ...... So on. I just want to add the value to an indicator every time I push the button.
The closest I can get is the vaue is displayed while I hold the button in and the it goes to 0 as I realese it. I want it to add up each time its pressed.
Thanks in Advance
Kevin
Solved! Go to Solution.
03-14-2011 11:50 PM
Without seeing any of your code so that we know what you have done, I'm going to guess that you failed to use a shift register to store the value that you add to every time you press a button.
03-15-2011 01:07 PM
This is the VI that I started with. I will read on in the help info as to how to use a shift register. If you have a simple way to explain how a shift register works that would be appreciated.
Thanks for your time.
KP2
03-15-2011 01:26 PM
Do you have a while loop with your code? Right now it looks like your VI just runs once.
(Please do not say you are using the Run Continuously button.)
I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
03-15-2011 02:12 PM
Hi
The best way to do it is by using an Action Engine. Look for a Nugget made by Ben and describing Action Engine (it is worth every second of your time spent of that). As a matter of fact, the action you need to do is a beautiful example of an Action Engine.
regards
N
03-15-2011 03:33 PM
Yes I was using the run continous button. 😞 but in my next attemt got me closer and now I tried this next example and this works, SO FAR. I still need it to reset the shift bit like a clear button. I'm close, thanks for your help.
KP2
03-15-2011 03:34 PM - edited 03-15-2011 03:35 PM
Not sure where to look for the action engine.
03-15-2011 04:04 PM - edited 03-15-2011 04:04 PM
Hi Kevin, this is Paul from Applications Enginering at NI. Try something like in my attachment. You can use case type statements to evaluate whether a button was pressed, then assign that true case a value. Good luck with it
.
03-15-2011 04:37 PM
03-15-2011 07:36 PM
Thanks Paul, that works great.