LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

event case

Solved!
Go to solution

Can we link an event case in one VI to a control on another VI or to a global variable in the same project?

 

I have a top level VI which has quit and abort buttons in it.  Rather than copy these buttons to all the other, popup VIs it would be much neater if the popup VIs could respond to events on the top level front panel. However, in LV 2010 this doesn't seem to be possible using event cases, so I re-wrote it using select case in while loops.  This is what we used to do in the 'old days'  of LV 6 but not as neat.

0 Kudos
Message 1 of 4
(2,504 Views)

Have a look at the dynamic event registration. There are also examples on this topic. This will allow you to react on events of controls on other VIs. Exactly what you need. You just need the control reference to register the event.

There are no events on global variables.

 

0 Kudos
Message 2 of 4
(2,501 Views)

Thanks Dan_u,

 

    I read up on registering events with interest,  and will try it out in future.  It does, however, seem to me to be a slightly '

busy' way of doing it.  Howcome we can't just select a control on another VI from within the normal event case menu?  So long as the VI is in the same project this seems reasonable to me.  Likewise having an event for change of value on global variables.    Regards, Barnsey

0 Kudos
Message 3 of 4
(2,484 Views)
Solution
Accepted by topic author Barnsey

A different VI has a different FrontPanel, so VI A is not aware of the controls on another VI B. Dynamic events provide a nice and easy way to handle events remotely.

There's also no "direct" way to write a value to a control that is on another VI. You need a reference to the control or implement another way to transfer data.

 

 

0 Kudos
Message 4 of 4
(2,478 Views)