07-03-2014 01:26 PM
I was wondering how feasible it would be to have a subpanel portray a sub-vi and allow the user to interact and observe changing values on the subvi, while simultaneously having the ability to control indicators and controls on the main vi, next to the sub-vi? For instance, having a subpanel with a sub-vi on the left and controls/indicators for the main vi on the right. The user should have the ability to control both in real time. Is that possible? If so, how should I go about doing it? I have not been able to come up with a good method. All help is appreciated. Thanks in advance!
Solved! Go to Solution.
07-03-2014 01:42 PM
Search the examples for subpanel. There are a couple of examples there on how to do this.
07-03-2014 01:50 PM
So I checked the tutorials, and they work great ONLY for using a subvi, finishing a task there, and then accessing the next vi in series. I would like to go back and forth between the two in parallel with very minimal pause in between. Is that possible?
07-03-2014 02:00 PM
Are you asking about a sub panel in a sub panel in a sub panel ...etc...
Or if I understand your question correctly your are asking about a subpanel with a sub VI front panel displayed inside that subpanel. Can you interact with both the main top level VI controls and the subpanel's subVI controls at the same time. YES! That is how the subpanel is designed to work.
But the top level VI only reads or writes to the controls on the the top level VI and the subpanel VI only reads or writes to the controls on the subpanel sub VI. The top level VI does not normally read or write to the controls on the sub panel and the sub panel VI does not normally read or write to the controls of the top level VI. (you can it you pass referances)
That is the benefit and the number one reson the use sub panels making your user interface code easier to write and maintain.
Each VI, rather its a top level or a sub panel, is only responable for its own controls
What have you tried os far? Post your code.
As for the other...
I have not tried it but I would think you could have a sub panel in a sub panel in a sub panel ...etc... and still interact with all the controls on all the sub panels at the same time.
07-03-2014 02:09 PM
@jfherrm wrote:
So I checked the tutorials, and they work great ONLY for using a subvi, finishing a task there, and then accessing the next vi in series. I would like to go back and forth between the two in parallel with very minimal pause in between. Is that possible?
You can spawn multiple sub VI and get them all running in the back ground. Then select which one to display or load into the subpanel as needed. Like if you used a tab control. Removing a sub VI from the sub panel does not end or stop the subVI from running and you can go back to when needed. The subVI does not have to "finishing a task there" but can keep on running even it its front panel is removed from the subpanel and replaced with another subVI
07-03-2014 04:36 PM
@jfherrm wrote:
I was wondering how feasible it would be to have a subpanel portray a sub-vi and allow the user to interact and observe changing values on the subvi, while simultaneously having the ability to control indicators and controls on the main vi, next to the sub-vi? For instance, having a subpanel with a sub-vi on the left and controls/indicators for the main vi on the right. The user should have the ability to control both in real time. Is that possible? If so, how should I go about doing it? I have not been able to come up with a good method. All help is appreciated. Thanks in advance!
Yes, having a sub-panel is the same as popping out a separate window, if you want both to be active you'll need to start the 2nd process as an asynchronos call, that's about it. They'll run separatly and control their own stuff.
/Y
07-03-2014 06:13 PM - edited 07-03-2014 06:13 PM
@jfherrm wrote:
I was wondering how feasible it would be to have a subpanel portray a sub-vi and allow the user to interact and observe changing values on the subvi, while simultaneously having the ability to control indicators and controls on the main vi, next to the sub-vi? For instance, having a subpanel with a sub-vi on the left and controls/indicators for the main vi on the right. The user should have the ability to control both in real time. Is that possible? If so, how should I go about doing it? I have not been able to come up with a good method. All help is appreciated. Thanks in advance!
What you are describing is what a subpanel does. You just have to make sure you are running your "subVI" asynchronously. Then your subVI isn't blocking any of your top level VI's loops from iterating.