Academic Hardware Products (myDAQ, myRIO)

cancel
Showing results for 
Search instead for 
Did you mean: 

Subpanel call.

Currently I am running a subvi in a subpanel.  I want to be able to run the subvi in the subpanel only when I select a boolean control on the front panel.  Is this possible?  I have attached the main vi.  I tried putting the code in a case structure and control it with a boolean control, but it crashed.  Also, in my while loop I will need to obtain read data from some analog input channels, is this possible.
 
-David
0 Kudos
Message 1 of 2
(6,877 Views)

Hi David-

One way to perform this efficiently is to use event-driven programming with an Event Structure in LabVIEW.  The reason your VI crashed when just polling a boolean every time and executing code based on the state of that control is likely that you were running the "Open Reference..." sequence many times on the same VI.  This can't work because once a VI is opened you can't open it again.Smiley Wink

Check out the file "toplevel.vi" in the .llb I have attached here.  It shows how to use events to ensure that the code is only executed when a change on the front panel control takes place.

I hope this helps-

Tom W
National Instruments
0 Kudos
Message 2 of 2
(6,873 Views)