LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV 2011 Ignore dynamic user events when already handling one

Solved!
Go to solution

Hello,

 

say I have a user interface which fires user defined dynamic events to control a certain process. These events are handled in a vi running in parallel. Say that the user decided to fire a "start" event, which is handled by the event handler, and now I would like the event handler to ignore all subsequent events until the "start" process has finished executing.Such that if the user fires off two "start" events, the second one will be ignored completely. Then when the "start" event has been handled, the events switched on again, so that the user my send another "start" event.

 

How do I do this in labview 2011?

 

In labview 2009, I unregisted the user event, and then registered it when the process finished.

In labview 2011, this doesn't work. After unregistering the user events, labview ignores all future events, even if you reregister them. (This causes my application to freeze, because it doesn't receive any more events. Which is very annoying!)

 

Can anyone help?

labjunky

0 Kudos
Message 1 of 6
(2,803 Views)

Did you check this discussion in LAVA, similar issue is discussed in this thread.

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
0 Kudos
Message 2 of 6
(2,801 Views)

Thanks FraggerFox, the technique used in that LAVA discussion is only useful for front-panel control events, and can not be used for dymanic user defined events, that are created with the "create user event.vi". (As far as I can tell).

 

Thanks for the link though I had not seen it.

labjunky.

0 Kudos
Message 3 of 6
(2,796 Views)
Solution
Accepted by labJunky

@labJunky wrote:

Thanks FraggerFox, the technique used in that LAVA discussion is only useful for front-panel control events, and can not be used for dymanic user defined events,


 

From what I understand from the link, rather than un-registering event using unregister event function in LabVIEW, try passing null reference to unregister it.

The trick is shown in the example: \general\dynamicevents.llb\dynamically register for events.vi

 

 


 Consider extending the example: I want to receive notification from user event as well, all the time. To unregister for the two events posted in the above example but not unregister for the user event, I have to use null registration. If I call the unregister primitive, I'll end up unregistering for my user event as well. Similarly using the global unregister primitive doesn't work if you have different dynamic events with different lifetimes.

 

-FraggerFox!
Certified LabVIEW Architect, Certified TestStand Developer
"What you think today is what you live tomorrow"
Message 4 of 6
(2,792 Views)

>From what I understand from the link, rather than un-registering event using unregister event function in LabVIEW, try passing null reference to >unregister it.

>The trick is shown in the example: \general\dynamicevents.llb\dynamically register for events.vi

 

Yes, I had a look at that example. But I don't understand how to create a "null refnum" for a user event.In the example, they use a static generic vi reference (as a null refnum), and wire it to the "register for events", to the "Mouse Move" event. But if I click on the "register for events" to select event type (i.e. "Mouse Move", "Mouse Down", etc) I can not select for the type "user events" (because it is not displayed in the drop down menu).

 

Any suggestions?

 

 

0 Kudos
Message 5 of 6
(2,779 Views)

Following the above anwsers I've understood now how to make a null refnum for a user event. 

 

To create a null reference for a "user event", right click on the "register for event" user event label and select create contant from the dropdown menu. This will create a user event constant which you can then wire to the "register for event". Subsequently, labview will ignore all future user events of that type, until you reregister the original user events. 

I've attached an example of what I mean. 

0 Kudos
Message 6 of 6
(2,551 Views)