From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Push button value change event

hi everyone,
 
I here have a push button. I want to capture the value change event. I can get the event using the event structure if i click on the push button. But i am also controlling this button using a local variable. I can't catch this event if the push button value is changed by the local variable.
Is there a way to know that i have changed the value no mattter if it's a click or a variable change?
By the way i also need to know if its from true to false or from false to true.
 
 
 
Thanks,
 
Tai

Message Edited by BestPker on 06-20-2006 02:38 PM

0 Kudos
Message 1 of 9
(3,584 Views)
If you were to replace the variable with a property node->value(signaling), it would behave as you would expect. There are however, better ways of going about this, but it's difficult to advise without seeing your code (also, I wouldn't be the best person to advise you anyways!). I had some event issues recently that can be seen here. That thread might give you some pointers as well. There are some meaningful explanations that are worth reading.
Message 2 of 9
(3,576 Views)

Hi Tai,

Can you describe what you are trying to achive with the button, not from an implementation point of view, but rather from a functional one. 

I also noticed that you wrote: "But i am also controlling this button using a local variable".  I'm not sure that this is a good idea.  There are better methods, but I need to understand what you are trying to do (and why) in order to share some suggestions.

JLV

0 Kudos
Message 3 of 9
(3,573 Views)
The only way to determine True to False and False to True is to use a shift register in a loop to hold the previous value.  Here is a vi that demonstrates how to do this.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 9
(3,566 Views)
tbob wrote:

"The only way to determine True to False and False to True is to use a shift register in a loop to hold the previous value"

That's not entirely true.  In the post I linked to that was part of my problem.  You can use the "oldval" and "newval" from the event data node to detect which change occurred.  You just have to make sure you don't program it the way I did!

Go with what Altenbach posted.
Message 5 of 9
(3,564 Views)

hi,

I am using this button as a control of the graph i am getting from a machine using the GPIB card.

When i click the push button labview starts recording the graph from the two meters i am using. But when i detect that the meter has reached the end i am stopping the graph so the push button goes to false.

I also want to do some manipulations after the graph is done that's why i want to know when it changes.

0 Kudos
Message 6 of 9
(3,561 Views)
Actually, Novatron, your method works for now. Thanks!
0 Kudos
Message 7 of 9
(3,549 Views)

Novatron,

You're on a roll today  😉

0 Kudos
Message 8 of 9
(3,541 Views)
Thanks JLV!

I seem to be having a productive day at work too...  Guess it's still early in the week so I've got plenty of time to lose all my steam.
Message 9 of 9
(3,535 Views)