LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question about Local Variables (Multiple answers welcomed!)

Hi

A lot of important things were said about local variables. Perhaps it might interesting to read this article of "Dr. VI" too (global variables):
http://www.ni.com/devzone/lvzone/dr_vi_archived1.htm

Regards,
Luca
Regards,
Luca
0 Kudos
Message 21 of 23
(569 Views)
Hi Jonas,

I couldn't kill 70, but only 50 variables...
The diagram looks less readable now, however. Partly that can be repaired by
better wiring.

Another good recommendation (which came up already in another answer this
thread) is to group variables by clustering them. I did it in one case in
the attached example.

Partly the problems with too many locals arise because you use some
variables in a double function, as control and indicator. This may be very
embarrasing to a user. But if you decide to do it that way you can't avoid
locals especially if you want to update them frequently in a loop.

In general one can often not avoid locals, at least in a user interface VIs
like yours is.
Many of the arguments why locals should be a
voided apply to their usage
within an non user-interface VI..

-Franz

"Jonas" schrieb im Newsbeitrag
news:506500000005000000060F0100-1042324653000@exchange.ni.com...
> Sorry for this messy VI I attached...
>
> I have renamed all the indicators/controllers using the labels in the
> diagram and the corresponding item in the front Panel with formatted
> text : should be easier to read.
>
> So if you would like to take some more time. I am not sure how to
> avoid 70 or so local variables...



[Attachment Project_NIM_NHQ_1.2b.vi, see below]
0 Kudos
Message 22 of 23
(569 Views)
Thank you for taking some time to make this example !!
0 Kudos
Message 23 of 23
(569 Views)