LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Intaris

Event handler termination

Status: Declined

Any idea that has received less than 5 kudos within 5 years after posting will be automatically declined.

I have previously asked tor ALL events in LabVIEW to be changed in functionality to be the same as User Events, but this has little support at the moment.  This would allow me to register and unregister (and cross-register) for any standard UI events at run-time.

 

One problem I have with event handlers at the moment is that they are ALWAYS registered for standard UI events, even if they have finished executing and have no chance of being re-called.  I would like to be able to tell the event handler that it should now UNREGISTER all standard UI events (until it is called again).

 

The following code (attached but without the Event terminator) will crash your PC if you let it run because the event structure accumulates data in the event queue, but can never read the data out.  This is not good.  I would like to be able to tell my Event structures to NOT do this.

 

Event deregister.PNG

 

Shane

Message Edited by Intaris on 04-21-2010 02:57 AM
5 Comments
JackDunaway
Trusted Enthusiast

Basically, you want all events to become dynamic events, with the cleaner syntax that static event registrations currently provide?

 

What does cross-register mean?

 

Does the stop terminal turn on and off each single event registration, or is it a structure "global" that turns off all event registrations for the structure?

 

Here are two good related Ideas: Option to discard stale entries in the event queue and Expand Event structure functionality: priority for events.

Intaris
Proven Zealot

Jack, I don't really see the two other options (which I would also like to see implemented) as alternatives to this because they will not do away with the accumulation of stale data in memory.  The program provided will still lead to a crash.

 

I would like the stop terminal to unregister ALL registered events for the Event structure until it is called again.  This will stop the events being fired from allocating memory uselessly in the background.

 

Switching all events over to user events would also provide this possibility.

 

With "cross-referencing" I mean the ability to change the control associated with a given event structure state during run-time.  I can have a "numeric" event which per default listens to a "Value Change" event from a control "Input" but in my code I can change the reference for the event registration to a different control ("Input 2" for example).  I can do this now also with user events, but need to actively avoid static events and use only user events.  This is do-able but is a bit of work.

Message Edited by Intaris on 04-21-2010 09:32 AM
Message Edited by Intaris on 04-21-2010 09:34 AM
JackDunaway
Trusted Enthusiast

I agree those other two Ideas are not alternatives, just related - just linking to them since a big events-overhaul should include those Ideas in my opinion. I'm Kudoing this Idea because it addresses another reason why I would like to have more control over the underlying event queue. I would not oppose blurring the lines between static/dynamic event registrations, merging toward all the functionality of dynamic event registrations with the cleaner syntax of static registrations.

Intaris
Proven Zealot

Jack, make sure to kudo my other suggestion also, I think it would be preferable to this option (although both would co-exist nicely)

Never mind, I see you already did.

Message Edited by Intaris on 04-21-2010 10:31 AM
Darren
Proven Zealot
Status changed to: Declined

Any idea that has received less than 5 kudos within 5 years after posting will be automatically declined.