08-21-2012 11:52 AM
Hi all
I am stuck with a problem.
Description of what I have:
I have a MainVI which calls a SubVI. The SubVI is dependant on the MainVI for certain inputs. In other words, it would give an error if I called the SubVI alone. Also, there is a condition before we reach the part of the code that executes the SubVI. In other words, the SubVI does not execute as soon as I run the MainVI
Description of what I want to implement:
What I want to do is, I want a switch on the MainVI, such that, when I trigger it ON anytime, I can SEE the SubVI popup (Please not, the SubVI should not execute, as it would give an error)
and when I switch it OFF anytime, the SubVI popup should disappear.
Problems I am encountering:
1. I cannot change the 'Window appearance' properties of the SubVI as I need it appear/hide as per the control of the switch.
2. I have tried using the property 'State', but that only works when the SubVI is executed. But i want to just see the SubVI, even before it is executed
Please help!
Solved! Go to Solution.
08-21-2012 12:18 PM
I believe you can set the SubVI to load with callers, then use VI server to show/hide the front panel.
08-21-2012 12:32 PM - edited 08-21-2012 12:40 PM
Here is an example. The core functionality is here. you have to decide how to pass the subVI reference. I put in a delay and a toggle for this example (toggle to snap the "run subVI" action back to false, not sure why the snippet makes that property node look funny).
I'm guessing there are some additional ways or considerations, but this example has the VI open and close the front panel without running the Sub. Then you can run the sub too. Of course your VI will "get to " the subVI some other way.
You can run the snippet, but you will need the SubVI, so I attached both files also. Also, change the directory for the SubVI path.
The show front panel = True has the method FP.Open.
***
Ok, the snippet took my property for the boolean and changed it to a reference, weird, but understandable.
08-21-2012 03:58 PM
Wow.. It works..Thanks Mark for the solution.
08-21-2012 05:16 PM
@Mark Ramsdale wrote:
Ok, the snippet took my property for the boolean and changed it to a reference, weird, but understandable.
You used the built-in LabVIEW snippet tool.
The Code Capture Tool is much better and doesn't do this.
08-22-2012 12:19 PM
HI,
I saw that code capture tool at NI week, I am going to add it to my bag o tricks. Lots of 'homework' from NI week stuff 🙂