04-09-2012 04:13 PM
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
Solved! Go to Solution.
04-09-2012 05:32 PM
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
04-09-2012 07:19 PM
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.
04-10-2012
10:00 AM
- last edited on
05-21-2025
11:05 AM
by
Content Cleaner
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.