From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

dynamic FG in multiple called vi's

Solved!
Go to solution

I've got an application in which from the main vi, I'm loading any number of reentrant instances of the same vi and its front panel.  Each instance of these "sub-main" reentrant vi's I'm trying to assign their own index in a functional global cluster array, like a local global, that can be called within each sub-vi of each sub-main instance.  This is such that each instance of the sub-mains and their sub-vi's can access their own set of variables, constants, tasks, etc from the same main FG.  The problem I'm running into is how to label each vi reading from/writing to the FG such that the read/written data is placed in the appropriate index corresponding to that vi's parent sub-main.  I've thought of assigning each sub-main a tag in their window title and using the "get caller's parent" from the openg package to read this tag and index the FG, but this would mean I'd have to tag every called vi within the sub-main, and when the final children vi's are N levels from the sub-main, this can get hairy.  I feel like I might be overlooking something really simple, but it hasn't yet occured to me.

 

Thank you for the assistance!

0 Kudos
Message 1 of 3
(1,972 Views)
Solution
Accepted by topic author Jeanius

This reminds me of Ben's nugget a few years ago, where he created a number of dynamic independant references with the little used occurrence VIs.

 

Rather than the coloured boxes, you could spawn off FGVs

 

EDIT: When you create your Sub-Main VIs, are you using VI Templates? If not, they are a very good way of managing clones of dynamic VIs

_____________________________
- Cheers, Ed
Message 2 of 3
(1,969 Views)

Wow, that's interesting.  I've never dealt with occurences before, this could be just what I'm looking for!

0 Kudos
Message 3 of 3
(1,957 Views)