LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

handling event in subVI

Solved!
Go to solution

Hi all,

 

I register an event (value change for a boolean array) in a subVI.  I connect the refnum with the dynamic event connector (event loop) the in the higher level VI.  So the loop will fire when the subVI's boolean array change.

 

It works well only if the front panel's subVI is opened.  I don't want the subVI running with the front panel opened.  Someone can help me to figure out what should be done?

 

Thanks.

0 Kudos
Message 1 of 3
(2,292 Views)
Solution
Accepted by topic author Santorro
This is the expected behavior. I would recommend that instead of using the value change event create your own user event. Then have your subVI trigger this event when it modifies the array. The event structure in the calling VI will receive your user event and take the appropriate action. Relying on a value change event is not the best way to do these types of things. Also, using a user event helps to decouple the UI from the processing tasks. This is a good preferred design because it is more flexible and easier to change one side or the other. As long as the event data is consist you are free to change either implementation.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 3
(2,286 Views)

I changed my programe to generate an user event as you proposed and it works well.  The subVI's front panel doesn't need to be opened anymore to update data in the top level VI.

 

Thanks for your help, it is appreciated.

0 Kudos
Message 3 of 3
(2,273 Views)