LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event registration question...

I was just wondering. Say you have three user events and you wire them to an event regitration node. If you hover over the event registration refnum wire with the wiring tool with context help open, you can see the three user event in the registration. Has anybody ever ran into a way to parse or "unbundle" the registration refnum to get references to the events that are registered in it?
 
If not, this might be a really nice addition... HINT, HINT, HINT...
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 1 of 7
(3,289 Views)
What in particular are you trying to do? Do you have a batch of User Events and you want to disable one of them or swap it out with another User Event?

There's a trick that's somewhat similar to what you're asking for, though I don't know that it directly helps you. You can register for multiple User Events separately, or you can bundle them together into a cluster (or a nested cluster of clusters...) and register for them that way. It's really more of an organizational tactic than anything, but maybe it'll spark an idea in your head.




Message Edited by Jarrod S. on 04-02-2008 12:43 PM
Jarrod S.
National Instruments
0 Kudos
Message 2 of 7
(3,272 Views)
You can register each user event you create with a seperate Register For Event then bundle the output event registration numbers into a cluster.
PaulG.
Retired
Message 3 of 7
(3,244 Views)
Excellent suggestion! I forgot you could do the inverse of what I suggested.
Jarrod S.
National Instruments
0 Kudos
Message 4 of 7
(3,240 Views)
In case anyone needs help visualizing this.




Message Edited by Jarrod S. on 04-02-2008 09:28 PM
Jarrod S.
National Instruments
0 Kudos
Message 5 of 7
(3,221 Views)
Thanks guys fior the replies, your answers didn't exactly cover what I was wondering about, but I didn't know about the bundling events events before registering them - might be able to use that some time...
 
The thing that got me thinking about the topic was that I have a piece of code that uses 5 or 6 user events. This results in 5 or 6 wires running from one end of the block diagram to the other so at the end I can destroy the user event. I know I could reduce the numbers of wires by bundling them or creating subVIs that create and destroy the events, but I was thinking about was to provide a more generalize solution that could accept an event registration as an input, extrace the events in the registration, destroy them and then unregister the registration.
 
But Jarrod your code brought up a question. Your last post shows unregistrations without destroying the underlying user events. If you do the unregister and there are no more active registrations for the user event, does LV automatically destroy the event? Take a case where a user event is created and passed to 2 or more independent processes running in memory. If the code doesn't ever explicitly destroy the user event, will LV ever destroy it automatically, if so when?
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 7
(3,187 Views)


mikeporter wrote:
 
I was thinking about was to provide a more generalize solution that could accept an event registration as an input, extrace the events in the registration, destroy them and then unregister the registration.

This is not entirely generalized, but I think LVOOP might help you here. If you create a general event class and then have each type of event as an inherited class, you can create an implementation for each class for each method (create, unregister, destroy) and call them all together. I'm not sure, because I can't look at it at the moment, but I believe you'll be able to find an example in something Norm Kirchner posted on LAVA. Try searching for "LVx".

___________________
Try to take over the world!
0 Kudos
Message 7 of 7
(3,179 Views)