11-04-2008 03:17 PM
Hi I'm new to labview and any help would be appriciated.
Basically I have one numerical control, which i want to be copied to a shared variable when a button is pressed(one that does not latch), afterwards I want the user to be able to change the value of the numeric control W/O changing the shared variable to the new value. The implementation is a single entry calculator in this case, but the project is just for learning.
I tried logic statements as well as case structures and I haven't made it work yet.
My question is there a function or subVI which makes an event only happen once, hypothetically the wire goes away after one cycle?
Any Help appriciated.
Solved! Go to Solution.
11-04-2008 04:25 PM
I would recommend an "Event Structure"
You can put the code inside the event structure.
For example, all of the arithmatic will be inside the structure.
This event will be linked to a mouse clicking the button.
For example, if the mouse clicks " + " then one thing will happen
If the mouse clicks " - " something else happens
.... and so forth.
I would go that route. I can explain more if you don't understant what I'm talking about.
11-04-2008 04:34 PM
Ford wrote:Basically I have one numerical control, which i want to be copied to a shared variable when a button is pressed(one that does not latch), afterwards I want the user to be able to change the value of the numeric control W/O changing the shared variable to the new value. The implementation is a single entry calculator in this case, but the project is just for learning.
I don't think you have the correct definition for a "latch action button", because that's what you actually need. Place the writing to the shared variable inside the true case of a case structure. Whenever you press the button, it will turn TRUE until it is read once and the resets to false again.
Alternatively, use an event structure triggered by a vlaue change of the button. The best choice depends on the rest of the code.
Maybe you should show us some code.
11-04-2008 04:43 PM
Thanks for the help guys, I will try your ideas tonight, and if I cannot make I work I'll post the code,
If it does work I'll credit where needed.
Thanks again
11-04-2008 05:05 PM
Thanks so much, I was very close the whole time and now it all came together, I just wired the addition fuction and its working, now onto the others.
Thanks
Much appriciated.