LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Show/hide mainVI button in subVI loop

i am working on a project and encounter a problem. How can i show/hide a mainVI button when my program is running in the subVI. I cannot copy the visible property node icon to the subVI FP. Any advice on this will be helpful, thanks.
0 Kudos
Message 1 of 6
(4,043 Views)
Lihui:

From your sub-vi, you can �Set Control Value� of a Boolean �hidebutton� (just for the lack of better names) in main.vi to true using vi property node. (Or you can also write to a global variable that can be accessed in main.vi)
In the main.vi, you can wire it to a case structure (or better yet to a dynamics events structure in LabVIEW 7.0), which has the property node/visible set to false inside it. When Boolean hide button is set to true, you will be able to hide the button. You could set visible to true in when boolean "hidebutton" is false as well if it's convinient for you

I hope this helps,

FightOnSCTrojan
0 Kudos
Message 2 of 6
(4,043 Views)
You can create a reference to the control in your main VI and then pass that reference to the subVI through the subVIs connector pain. Then you can create a property node in the subVI and connect the reference to it. You can now choose the "Visible" property and then hide your control.

Rob
Message 3 of 6
(4,043 Views)
Rob:

Thanks for this much more elegant way of handling control refnums!

FightOnSCTrojans
0 Kudos
Message 4 of 6
(4,043 Views)
hi robert. i tried this method but the property node only makes the subVI ref button at the subVI front panel visible. The main front panel button remains the same. please correct me if i miss something. thank you
0 Kudos
Message 5 of 6
(4,043 Views)
I think that you might be missing something. Here is a quick example of doing show/hide in a subVI. You'll notice that I created a reference to the Button that I wanted to hide (or show) and passed that into the subVI. I then connected that reference to the property nodes.

Hope this answers your questions.

Rob
Download All
0 Kudos
Message 6 of 6
(4,043 Views)