LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sub vi used in main vi

Download this .zip and extract all files to a folder, used LabVIEW v9.0f2.

 

I want to use Light Show as a Sub VI to Furnace Cycle MAIN1 (Front Panel) - I need to use this Sub VI (sub of one light control) with many light on the Furnace Cycle MAIN1 front panel.  In the light show VI, I am using an enumerated control to simulate inputs from a future PLC and the boolean switch simulates power is applied to that PLC.  The light color is white when the PLC is not active or does not have an output to the light.  The light show VI is written in the form of a state machine.  I need to to have a stop boolean control to stop the Furnace Cycle MAIN1 program and all the sub vi's. Any help would be appreciated.  I am open for other code processes like arrays etc. to accomplish the same results.

0 Kudos
Message 1 of 2
(2,665 Views)

The Light Show SUB VI has a while loop in it. This would cause a problem when trying to communicate with it from your main VI as it will always wait for the subVI to complete executing before moving on to any other code that you want to run after it. I would recommend removing the while loop from the subVI and just keeping the case structure and its contents in the subVI. This way, you can have the Light Show subVI inside a while loop in the main VI. This will allow you to place a 'Stop' control in the main VI, which can be wired into the subVI as well.

 

I hope this helps you out. 

Vivek Nath
National Instruments
Applications Engineer
Machine Vision
Message 2 of 2
(2,620 Views)