Jump to content

Programatically "Discard Event " in an event structure


Recommended Posts

QUOTE(TobyD @ Jan 16 2008, 12:08 PM)

Something like this:

http://lavag.org/old_files/monthly_01_2008/post-8758-1200503208.png' target="_blank">post-8758-1200503208.png?width=400

Or as Aitor said you could check that the NewVal parameter is True.

This is what i am doing right now. but I have a "INSERT QUEUE" function that will navigate the control to diferent part of the states in the state machine. On the "value change" from "True" to "False" i would not like to navigate to other states.(rather i would like to stay in the "IDLE" state which is the state where i handle all the value chnages and other events in the EVENT structure). Only when the boolean value is changed from "False" to "TRUE" i would like to navigate. So i need a mechanism to discard the event. It looks like registering this boolean dynamically and handle the events would be a good idea. let me try it out.........

Link to comment

How about simply enabling\disabling the control? That way the user can't trigger a value change event when you don't want to. And if you are programmatically triggering a value change event, you can simply read the status of whether the control is enabled or not, and then decide to execute code.

Link to comment

QUOTE(Yuri33 @ Jan 17 2008, 11:16 AM)

How about simply enabling\disabling the control? That way the user can't trigger a value change event when you don't want to. And if you are programmatically triggering a value change event, you can simply read the status of whether the control is enabled or not, and then decide to execute code.

Disabled controls will still trigger an event. That said, you can check if the control is disabled or not, and decide whether to execute the code as you're suggesting.

Link to comment

QUOTE(crelf @ Jan 17 2008, 11:01 AM)

Disabled controls will still trigger an event.

But not by the user, correct? In my experience, if I disable (or disable&gray) a control, when the user attempts to change the control (button press for a boolean, increment\decrement for a numeric, etc.), nothing happens, and no value-change event is triggered. Perhaps the mouse down event is, but not the value change event, and I thought that is what was at issue in this thread.

But I do understand that even if the control is disabled, that doesn't prevent a programmatically triggered value-change event. Hence the second part of my suggestion that you mirrored.

Link to comment

QUOTE(Yuri33 @ Jan 17 2008, 06:31 PM)

But not by the user, correct? In my experience, if I disable (or disable&gray) a control, when the user attempts to change the control (button press for a boolean, increment\decrement for a numeric, etc.), nothing happens, and no value-change event is triggered. Perhaps the mouse down event is, but not the value change event...

Yes - you're absolutely correct. I was thinking of the mouse-up event (the one I use the most on UIs). Sorry for the confusion.

Link to comment

QUOTE(crelf @ Jan 17 2008, 06:53 PM)

Yes - you're absolutely correct. I was thinking of the mouse-up event (the one I use the most on UIs). Sorry for the confusion.

I can not disable this "boolean control" since its in the hand of the user/operator. Actually this bollean is having the mechanical action as "switch when pressed" and changing the value from "False" to "TRUE" will start running "Test scripts/suites" automatically one after the another (like loading the config files and stuff like that and all the controls in the front panel except this "boolean" are disabled) . Now Changing the Value from "True" to "False" must "ABORT" the "Test scripts/suites". and hence the "boolean" must always be enabled.

Now the problem is one of the "state" in the "state machine" is responisble for the exectuion of "Test scripts/suites" automatically (its in a while loop(a while loop in a "state" of the "state machine")) and if i changes the value of the boolean from "true" to "False" then the "value" change event gets triggered which i do not want to happen. (since i am taking the control refnum of this boolean and checking the boolean state in one of the subvi) and this event i need to discard.

Hope i have explained enough about the problem.

Also currently i am doing some "QUEUE" operation that will remove unnecessay inserted state during this boolean event and the application is running quiet well without any problem. but somehow i am not happy with this part of the code.. So can anyone please suggest

PS: The event case which handles this boolean event whose property "Lock Front Panel until the event case for this event completes" has been "UNCHECKED"

Link to comment

QUOTE(guruthilak@yahoo.com @ Jan 17 2008, 10:06 PM)

and if i changes the value of the boolean from "true" to "False" then the "value" change event gets triggered which i do not want to happen.

Instead of wiring to the value (signaling) property, which produces a value change event, you can instead wire to the value property, which will change the boolean to whatever you want without triggering a value change event.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.