annulla
Visualizzazione dei risultati per 
Cerca invece 
Intendevi dire: 

adding user events

Risolto!
Vai alla soluzione

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
Messaggio 1 di 8
4.305Visualizzazioni

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
Messaggio 2 di 8
4.291Visualizzazioni
here they are in LV8.5. LV allows me to save down to 8.0 if that's needed.
0 Kudos
Messaggio 3 di 8
4.280Visualizzazioni
Soluzione
Accettato da autore argomento 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 

Scarica tutti
Messaggio 4 di 8
4.269Visualizzazioni

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
Messaggio 5 di 8
4.264Visualizzazioni

Hi jcurl,

 

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

 

Best regards

Dippi 

 

Messaggio 6 di 8
4.257Visualizzazioni

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
Messaggio 7 di 8
4.240Visualizzazioni

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
Messaggio 8 di 8
4.234Visualizzazioni