LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Showing unqiue front panel for multiple instances of subVI call

Solved!
Go to solution

Hi,

 

I have a subVI that looks at a 2-D array of data and plots some graphs.  I call the subVI and it opens the subVIs front panel to display the plots.  Now I would like to put the subVI in a for loop and call it several times with different 2-D arrays.  I am trying to figure out how to make several instances of the subVI's front panel appear. Essentially a front panel for each 2-D array.  All I can get it to do is to open and close the UI for each subVI call and for the last array display the UI for that data.

 

I tried making the VI re-entrant and selected the option to pre-allocate memory for each clone.  Maybe this is working, but I need the front panel from each subVI call to stay open.

 

Thanks,

Gary

0 Kudos
Message 1 of 4
(3,454 Views)

In this thread I posted code that spawns a bunch of FP to demo how to generate occurences but you can ignore that part.

 

looks like this when it runs.

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(3,450 Views)

glstill wrote:

I tried making the VI re-entrant and selected the option to pre-allocate memory for each clone.  Maybe this is working, but I need the front panel from each subVI call to stay open.


This won't work if you're calling the VI in a loop.  You'll get one clone for each time the VI appears on the block diagram, not for each time the VI is called.  A VI inside a loop only appears once on the block diagram so you only get one clone even though the loop runs multiple times.  If you need each loop iteration to spawn a new copy of the VI, you'll need an approach like the one Ben suggests, although it's now recommended that you use a reentrant VI instead of a template.

Message 3 of 4
(3,432 Views)
Solution
Accepted by topic author glstill

Thank you both for the help.  I used the Open VI reference and Call by Reference and created a stricly typed VI reference to call the subvi dynamically.  Attached is a screenshot of the block diagram.  The link below guided me in created the stricly typed VI reference required by the "reference" input of the Call by Reference function.

 

https://www.ni.com/docs/en-US/bundle/labview/page/creating-a-strictly-typed-vi-reference-to-call-vis...

0 Kudos
Message 4 of 4
(3,416 Views)