thutch79 wrote:Thanks for throwing together that example. I think this is probably my best approach. If I can summarize, you spawn the clones within a for loop by opening a reference and using ACBR to start them. Each sub then registers itself with a FGV by loading in the VI's ref from the "This VI" node. The FGV is then used to grab the desired reference in order to insert it into the subpanel.
That approach will certainly work. As I said before, it creates a potential race condition upon start-up. Since the sub has to register itself, I need to find a way to communicate that all subs are up and running before allowing the system load its initial sub-UIs.
Thanks all for the great help and advice. I learned a little more out of the experience.
Glad that example helped.
As far as your startup sequence, I'm not so sure its an issue of a race condition as it is, "What is responsible for what". Obviously you have the launcher that would start your main UI. The next question should be is this main UI responsible for control of these subvi's or do they run totally independent. If the Main is responsible for the life of the subvi/gui then it might be better for the Main to launch these vi's instead of the launcher. Like I mentioned if you create a notifier in your main and then pass that into your subvi, the subvi can send a notification to main letting it know its fully loaded. Since main knows how many subvi's it has launched it can wait for all these notifications and then continue and load the subpanel or error if there is a problem. Basically the notifier replaces the Functional Global. This notifier would also give you a good way to pass information from the subpanel up into the main if needed.
It seems like you are in the stage of development where I was a little bit ago. Have you considered looking into the actor model of programming? If your interested you could look into the actor framework or do some research on Daklu's Actor Oriented info. The site Lavag.org has a lot of good info. This link might get you started: http://lavag.org/topic/17035-feedback-requested-daklus-ni-week-presentation-on-aod/