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: 

Selecting which front panel's instance (clone) to display from a static reference

Question: How do you open static vi reference to a specific clone?  Is there  a list of clones in memory, and one can be selected?

 

Description:  I have a Vi subvi set up, where several of the vi's 2 levels deep call the same re-entrant control panel vi which is 4 levels deep.  I would like to use a static vi reference-subpanel combination to allow the user to do a "pop up" window that calls the control panel vi.  However, when I call the vi with a static reference I get one of the clones !!!!

 

There must be a way to call the front panel of a clone (instance) of a vi.  

 

but HOW!

 

 

-Eximo 

-Regards

eximo
_______________________________________________
UofL Bioengineering M.S.
Neuronetrix

"I had rather be right than be president" -Henry Clay
0 Kudos
Message 1 of 4
(2,713 Views)

One option is to dynamically create the clones by calling the Open VI Reference function with an 8 wired to the options input and running that VI using the Call By Reference node. This will give you a specific reference for each clone both for running and for the FP. This is probably what I would do.

 

Another option is to try the subVI's Callee's property, which might return the clone names (that's the VI name with a :X appended to it, where X is the clone number). I'm guessing this actually won't work, but you can try. You can also use the clone name to open a reference directly to the clone using the Open VI Reference primitive.

 

One last option is that you can use the Clone Name property inside the clone VI to register both clones in a global location, which you can then use to get the names of the actual clones in memory.


___________________
Try to take over the world!
0 Kudos
Message 2 of 4
(2,712 Views)

Similar to the second suggestion above, I have also used the 'Call Chain' to get the name of the clone VI instance, and wired that string into the 'Open VI Reference' with success in LV14.

0 Kudos
Message 3 of 4
(2,535 Views)

Note that since I posted that reply, people in LV R&D have posted that the ability to open a reference to a clone by name is actually an accident (the relevant people there weren't really aware that this can be done) and has some potential dangers associated with it, because there are places where LV assumes that a clone only has one reference which LV manages.

 

I don't know if they will block the ability to do this in future versions, but I would say that even without that, this is a relatively good reason to use my first suggested solution.


___________________
Try to take over the world!
0 Kudos
Message 4 of 4
(2,522 Views)