12-05-2012 01:11 PM
Hi all,
I have a question concerning subpanels: how is it possible to use the "Insert VI" invoke node in a loop ? When I do this, using a table of references to my subpanels as an input, only the last panel stays on display.
Thanks in advance !
T
12-05-2012 01:19 PM
I'm not sure I understand. Can you share some code so that we have a good reference.
12-05-2012 01:24 PM
Here is a screenshot of my test.
12-05-2012 01:27 PM
Yes, the last reference you pass into the Insert is the one that will be in the subpanel. What did you expect to happen?
12-05-2012 01:40 PM
@crossrulz wrote:
Yes, the last reference you pass into the Insert is the one that will be in the subpanel. What did you expect to happen?
Just for clarification, they all will be loaded but only the last will actually get displayed. It is just that the loop will run fast enough that the user will not see the other subpanels being loaded. Not sure if the compiler would be smart enough to bypass even trying to load the other ones or not. Either way, only the last one will be active.
12-05-2012 01:43 PM
Thanks for your answers.
So there is no way to make something like this work ?
12-05-2012 01:44 PM
In order to display multiple items you would need to have multiple subpanels. A single subpanel can only display one thing.
12-05-2012 05:46 PM
Tycho,
Only one VI can be in a SubPanel at any time and you can't create new SubPanels on your front panel at runtime. You can load VIs into SubPanels but the SubPanel must exist.
You could do something like this where you create a bunch of SubPanels, load your VIs into the SubPanels in a loop, and then hide the SubPanels you aren't using:
Getting more advanced you could programatically move and resize those SubPanels to ensure they take up all the available space.
Hope this helps,
Simon
12-06-2012 04:14 AM
Hi Simon,
Thanks for your answer.
How do you get this:
?
Cheers,
T
12-06-2012 10:59 AM
@tycho75 wrote:
Hi Simon,
Thanks for your answer.
How do you get this:
?
Cheers,
T
Create your subpanels. Place a VI server Reference constant on yoru block diagram. Right click on it and link it to your desired subpanel.