LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

front panel lock/freeze while SubVI is executing

If I call a subVI from a Main VI, can I freeze/lock the Main VI? I don't want the main front panel to disappear but also I don't want the user to be able to make changes to controls while the subVI is running.
Thanks for any suggestions
ANDY
0 Kudos
Message 1 of 7
(5,804 Views)
Two possible solutions:

1) If the subVI is called as a result of a front panel control then you could utilize an event structure, place the subVI within the event structure, and ensure that the "lock front panel until the event case for this event completes" box is checked (found near the bottom of the "edit events" dialog box). The downside of this method is that ALL controls will be locked, which can be an issue if you want to give the user a controlled option to stop execution at any time.

2) Using property nodes, individually disable the front panel controls before calling the subVI and then re-enable them after the subVI is finished (using a sequence structure).
0 Kudos
Message 2 of 7
(5,804 Views)
I'm using the call by reference on special events. Controls are checked in a while loop. Therefore I think I have to use nr. 2 of your solutions. Is there really no possibility to avoid using every single property node?
Thanks for your input!!
Andy
0 Kudos
Message 3 of 7
(5,804 Views)
Attached is an example VI that disables all front panel controls with very little effort. (LV 7.1) I've also attached an image of the block diagram in case you're using an earlier version of LabVIEW.
Download All
Message 4 of 7
(5,804 Views)
Great. That is exactly what I was looking for. I was able to insert this code into the SubVIs that I'm calling. In this way I don't have to insert the code everywhere I'm calling the SubVIs.
Thanks very much...
ANDY
0 Kudos
Message 5 of 7
(5,804 Views)
Why don't you just change the VI windows property of the subVI to "modal"? (VI properties..Windows apperance..customize). No coding needed!

Quote from the online help:
"Modal � Keeps the front panel on top of all other LabVIEW windows until you close the window or open another modal window. You cannot interact with other windows while a modal window is open. Most dialog boxes in LabVIEW are modal windows, such as the Options dialog box."
Message 6 of 7
(5,804 Views)
Thanks very much. Thats of course the easiest way.
Didn't know that.
ANDY
0 Kudos
Message 7 of 7
(5,804 Views)