LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How does Labview treat a local variable? Is it a reference to memory, or is it a copy of a variable in memory? If its a copy then how does it change the original value when "write local variable" is selected?



I use local variables to pass data from different parts of multithreaded applications. Is this the appropriate way to do this?
0 Kudos
Message 1 of 3
(3,551 Views)
Hi,

A Local variable is a reference to your front panel control or indicator. When you read from a Local Variable you create a new buffer of data. When you Write you transfer back to the origin buffer, eg back to the front panel control.

The Locals variable are only visible ( in scope ) to the VI they are associated with.

Using Locals to pass data from different parts of the application is OK as long as you have taken every precaution to ensure the same data is being passed. If in doubt wired direct.

Regards
Ray Farmer
Regards
Ray Farmer
Message 2 of 3
(3,551 Views)
As Ray mentions, a local variable uses a new buffer for each instance. This can use a lot of memory depending on how many locals you use and the contents. The LabVIEW documentation has information on memory usage.
0 Kudos
Message 3 of 3
(3,551 Views)