02-15-2011 02:04 PM - edited 02-15-2011 02:05 PM
I know pop-up the front panel of a subVi when called by selecting VI Properties>>Windows apperence.
But what I need to do is: always run the SubVI inside the parent VI as the nornal subVI do without poping up. But when I click a button"show front panel", the SubVI popup the front panel.
Is there anyway to do this?
Thanks,
02-15-2011 02:31 PM - edited 02-15-2011 02:32 PM
ossoo,
You can use a static VI reference to the subVI and then use the Front Panel Open invoke method to show the front panel when you want. I have attached two VIs that show this. I saved these VIs for LabVIEW 2009 so you should be able to open them up and run them in 2009 or later. Add.VI is the subVI that you are calling. The Caller.VI is just a While Loop that contiually calls the Add subVI. Inside of the While Loop is also a Case Structure with a Static VI Reference (you might need to change the path this is pointing to after downloading the VIs to your computer for this to work) and the Front Panel Open invoke method. You can run the Caller.VI and interact with the main Front Panel as normal and see the subVI but then you can click the Open subVI? boolean button and it will open the subVI's front panel. You can continue to interact with the main front panel and see the values update on the subVI's front panel as well. You can just close the subVI's front panel when you are done viewing it. Does this help?
02-15-2011 02:34 PM
02-15-2011 04:51 PM
In my subVI, I have some controls like "modify", "OK" and these buttons are used for event-driven function. And "done" for stopping the while loop. But when I put this subVI inside a parent VI, I can not control these, except that open the subVI. I know the normal control for subVI.
But is there any way to make the control in the parent VI possible to access the controls inside the while loop in the subVI?
Thanks,
02-16-2011 09:03 AM
You can pass control settings to your subVI while loop before its first iteration by simply 'wiring them in'. Although you wont be able to change these until the subVI while loop completes and you come to the next iteration. There are ways to pass variables between loops (such as local variables or queues) but these are fairly application specific.
Could you attach your code so we can get a better idea what's going on?
Pete