LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SUB vi doubt

Hello,

           I have program written in SERIAL communication RS-232. Everything is written in while loop once after open the serial port and by the way close port is also present out of the loop. The main program is present in the while loop and it is written in JKI state machine with 8 states. Now, I would like to convert these whole while loop into subvi. In this process, I strucked with some doubts. When I converting the whole while loop into subVI,"it displays a message that says functionality might change due to controls and indicators". I used some indicators and local variables inside the while loop which may create problems after converstion. Is there any way to do this. I want to use these subvi after that in a event case structure.

 

Any help regarding this.

0 Kudos
Message 1 of 3
(2,347 Views)

Put the controls out front of the while loop. For the indicators, create references that you will pass to the subVI. In the subVI use property nodes with the value property to update the main vi indicators. If you have a couple of references to pass to the subVI bundle them and pass a cluster of references to the subVI (then you unbundle them in the sub). This makes a cleaner diagram.

 

Watch you diagram wiring, you have wires going from right to left. Also instead of using a case structure on the error wire just to have the true/false error status use the unbundle by name function to get the status of the error cluster. I would also suggest you have a look at the Select function from the comparison palette, you could use it to replace some case structures.

 

Ben64

0 Kudos
Message 2 of 3
(2,317 Views)

I have deleted the existed controls and indicators that make problems when I am converting into subVI. But, I have only remaining with two controls and two local variables of that controls. I can't delete them and if I drag those controls and local variables infront of while loop may cause race conditions. How to get rid of those local variables?

0 Kudos
Message 3 of 3
(2,260 Views)