10-21-2008 01:02 AM
I have two VIs that both generate user events (in the real application the may have mutliple events, may be added to in the future). These two VIs should be independent of each other for reuse under source control so I'd like to keep a generic solution if possible. When I wire one after the other, the event structure only allows me to generate user events from one of the VIs (the last one) and not from both subVIs.
Any elegant workarounds?
Solved! Go to Solution.
10-21-2008 02:21 AM
Hi jcurl,
Can send the VI's in Ver8.5............
10-21-2008 02:51 AM
10-21-2008 03:59 AM
Hi jcurl,
here a solution for you.
You have to wire the "user event out" to the connector pane.
Then you can use the "register for events" node in your main vi.
As attachment there is an screenshot and the fixed example.
Best regards
Dippi
10-21-2008 04:16 AM
This is what I ended up doing already.
Is this expected behaviour for LabVIEW event registration? Can it be explained so I can better understand what's going on "under the hood"?
What if I need to add more events based on a state machine? E.g. state A would register device A/subVI A for events and state B would register device B/subVI B for events and state C would contain the event structure? Would this still work?
Or am I better off moving to a QSM (Queued state machine)?
Thanks
Jason.
10-21-2008 04:42 AM
Hi jcurl,
state machine...just like this(e.g.):
Best regards
Dippi
10-21-2008 05:30 AM
Hello Dippi,
What happens if I have a lot of events (10 or so)? It looks like that I need to register dynamic events outside of loops. It appears to me that LV8.6 dynamic registration is rather static in that it must be able to determine at compile time the list of all events.
For example, I tried to see what happens if I dynamically register all events with a while loop (that would allow me to have, say 100 events from 10 different VIs). But the event structure can't figure out what I want to do. I've attached your modified example for info.
Thanks,
Jason.
10-21-2008 05:59 AM
Hi jason,
it would be better to register the events outside of a loop.
Or you can use the "First call" function.
The way you use the "resiter events" node is not right.
you have to expand the node and register every event.
Best regards
Dippi