11-27-2017 09:57 AM
Greetings!
I'm fairly new to using event driven structures. The problem I have is when it is used in a single VI to react on "Value Change: it works fine, but when I use it in a sub-VI, it doesn't work at all.
Any advise?
11-27-2017 10:02 AM
You'll need to post the code (not a picture) so we can see how the rest of the VI is written. This is not enough information to help narrow down the problem.
11-27-2017 10:25 AM - edited 11-27-2017 10:27 AM
Yes, please attach your code.
11-27-2017 10:32 AM
this program is far too large, and too complicated to explain. I will make a simple example and send it
11-27-2017 10:36 AM
The event structure on the subVI is looking at the controls on the subVI. And it will not react to programmatic value changes (you pass data in or write with a local variable).
In general, your GUI should be done by a single loop with an Event Structure on the top level GUI. And the timeout should not be needed in 95% of the applications out there. Let your subVIs do one specific thing that does not depend on the GUI and then you open yourself up to being able to reuse that VI elsewhere.
11-27-2017 10:39 AM
Two options, look at the examples:
Number 2 is probably the easiest to implement.
mcduff
11-27-2017 10:47 AM
CAN use dynamic Event registration IN A SUB-VI to register for value changes in the FP of another VI.
See here for a nugget on Dynamic Event registration.
I use that very often when I have a sub-VI devoted to a very small part of the main application.
Please note that you have to think about if and when the GUI is locked on the event and that static events are serviced before dynamics etc etc etc.
Ben