05-13-2014 02:16 PM
Hi
In my code I have some arrays and local variables of array.
When i highlight the section of code to make it a vi, those Arrays and local variables are thrown out of the subvi as terminals.
How can I keep them inside?
Thanks
05-13-2014 02:18 PM
Use data flow (ie wires) instead of locals.
05-13-2014 06:37 PM
A little more detail. Local variables are not temporary storage locations. They are essentially duplicate terminals of a front panel control or indicator. You cannot place a local variable linked to a control on the main VI into a subVI.
So, when you try to make a subVI from a segment of code which includes local variables, the LabVIEW development system creates new controls for the subVI and wires them in place of the local variables.
As crossrulz suggested, you should use wires rather than locals. With a very few, very limited exceptions local variables are not needed and not recommended in good LV code.
Lynn