LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it ok to use local variables within the same loop?

Yeah you are right😇. I'm just mentioned about to avoid LV in a same loop instead has the option to use FGV. Thanks

0 Kudos
Message 21 of 22
(389 Views)

@Magesh003 wrote:

Yeah you are right😇. I'm just mentioned about to avoid LV in a same loop instead has the option to use FGV. Thanks


Still no reason to suggest a version which is only marginally better than the bad one they are trying to replace.

 

The only time I will use a local variable inside a loop would be if is it a case statement that is part of some UI handling code and I need to update a control or indicator on the front panel in multiple cases. While the preferred method would be to update the indicator outside of the case structure there are times where there are quite a few cases and the update will only occur in a couple of the cases. Rather than have a pass-through wire in every case I might use the local variable to update it in the few required cases. However, this is done intentionally and race conditions are not a factor.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 22 of 22
(368 Views)