LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with Event Handling

Hi,
I'm having a problem handling certain events. Here's the situation.

On my front panel, I have (among other things) a digital control and some boolean controls. When the user enters a number in the digital control, I have a value changed event that checks that number against the controls min/max values and displays a dialog box if the number is not within range. Everything works fine if the user hits any key or clicks the mouse on empty space after entering an out of range number. The problem is if the user enters an out of range number and then hits one of the boolean controls. In that instance, I get the out of range message, but the event structure also handles the case tied to the boolean event right after the value changed even
t. How can I keep the event structure from handling both of these events?
0 Kudos
Message 1 of 3
(2,912 Views)
Without getting overly complicated, I suggest using an boolean "in range" indicator instead of the dialog box. First, its less obtrusive, and secondly you can use the value of the indicator to gate the function of other controls.

In your instance, in the "value changed" event for the Boolean wrap your code in a Case structure with an "in range" local variable wired to the Selector. If the value is in range, execute the code, else -- maybe now alert your user with a friendly dialog box stating that Digital Control X must be with in certain ranges. Be sure to leave the Boolean control outside the Case structure so that it can be "read".

Aternately, you could programmatically set the range of the Digital control so that the user could not enter a value that w
as out of range.
Message 2 of 3
(2,912 Views)
hi, this is an improvise vi which uses in-range's output to gate other boolean controls.

comments welcome.
and, hope it helps.

regards
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 3 of 3
(2,912 Views)