LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

adding user events

Solved!
Go to solution

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?

 

0 Kudos
Message 1 of 8
(3,252 Views)

Hi jcurl,

Can send the VI's in Ver8.5............ 

Regards
Aks

(Appreciate answers by giving KUDOS)
Hit the stars.............. sky is not the limit.
0 Kudos
Message 2 of 8
(3,238 Views)
here they are in LV8.5. LV allows me to save down to 8.0 if that's needed.
0 Kudos
Message 3 of 8
(3,227 Views)
Solution
Accepted by jcurl

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 

Download All
Message 4 of 8
(3,216 Views)

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. 

0 Kudos
Message 5 of 8
(3,211 Views)

Hi jcurl,

 

state machine...just like this(e.g.):

 

Best regards

Dippi 

 

Message 6 of 8
(3,204 Views)

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. 

0 Kudos
Message 7 of 8
(3,187 Views)

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 

0 Kudos
Message 8 of 8
(3,181 Views)