LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event being missed? why doesn't this work?

Hi,
I've been staring at this code for a while and can't figure out  why it won't work.  Hopefully someone elsecan see it. 

What I want is for a message dialog to pop up any time the indicato light goes off, so suggestions on a better way to to it are also welcome.
0 Kudos
Message 1 of 12
(3,317 Views)
I could not open your vi because I'm at 7.0, but you need to write to the Value (Signaling) property node for the indicator to make events work with front panel indicators.
0 Kudos
Message 2 of 12
(3,312 Views)
hmm, thanks.  That seems to be somewhat the right track, however writing to the value(signaling) property node caused the event case for value change to occur every time, even though the value did was not changing 😞

I've attached a picture of my block diagram for those who can't open my vi (which is from LV 7.1)
0 Kudos
Message 3 of 12
(3,305 Views)
0 Kudos
Message 4 of 12
(3,289 Views)
Hi Holomorph, (i think) you make a valid point that selecting "value change" in the event definition implies the event-case is supposed to fire on a change, actually it could/should say "value update" - because that's how it works!Smiley Wink
 
Try dropping a numeric control on the FP and add a "value change" event for it.  Notice an event fires whenever the value is edited - even if the numeric value doesn't change!  The event-generation triggered by value-signaling is consistent with a user "edit" (or "update") event - and I hope NI keeps it this way!
 
Cheers!
 
(P.S. The attached popuptest.vi is saved in LV7.0)

Message Edited by tbd on 03-30-2007 07:55 PM

"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 5 of 12
(3,288 Views)
I'm missing a subVI for your code 😞

0 Kudos
Message 6 of 12
(3,254 Views)
There is a much simpler solution. Just create a new event case for control: value change and put the button in it connected to the value(signaling) of the LED. When you click the button, this event will fire and only then will the LED event fire. Now you can just check if the LED is false and pop up the message.
 

Message Edited by Marc A on 04-02-2007 04:19 PM

0 Kudos
Message 7 of 12
(3,245 Views)
that solution seems ok at first, but then we're really monitoring the control for change and not the indicator.  Unfortunately, that won't work if the output is comming from a subvi instead of a control.

Shouln't there be a simple way of monitoring an indicator for a change, or is that just not something many people need?
0 Kudos
Message 8 of 12
(3,200 Views)
Well if it comes from a sub VI, you'll know when it changes. All you have to do is see if it's false and pop up the message after the sub VI runs. Use a local variable to read the value before the sub VI executes if you need only the case when it goes from true to false. I think you're making this a bit harder than it has to be.
0 Kudos
Message 9 of 12
(3,190 Views)
I was trying yesterday to use a local variable to get the previous vlaue, but with a control connected to my indicator, in which case the local was being updated first, so it didn't work (maybe this isn't always the case, I don't remember now exactly how I had it wired).  With a subVI however, the local will acually have the last value, so it works.

I've attached my solution in case anyone is interested.  It is devided into two wile loops, the one on the right would be the "main program", and the one on the left just displays the dialog, that way it doesn't hold up the main loop waiting for the user to click OK.
Download All
0 Kudos
Message 10 of 12
(3,176 Views)