From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-08-2015 05:22 AM
Hi,
It is well know that Local variables make copies of data buffers. Let's say that I have array indicator that called "Buffer". When I'll create a Local variable, labview immediately create a new buffer associated to the original indicator call "Buffer".
Thanks a lot,
Idan
10-08-2015 05:39 AM
Idan,
each reading variable is a copy of the value. This holds true for both local and global ones. So each reading variable instance duplicates the original data set.
Doesn't matter what OS you are running, it's always the same.
Norbert
10-08-2015 01:38 PM
Local Variables are sometimes necessary, but the Conventional Wisdom is they should be avoided, if possible. Wires are preferred ...
Bob Schor
10-08-2015 02:06 PM - edited 10-08-2015 02:08 PM
Yes, front panel objects (even without any local variables) causes typically three copies of the data in memory. (1) The data allocated by the wire, (2) the transfer buffer, (3) the indicator on the front panel. Since front panel updates are asynchronous, the code only updates the transfer buffer, while the UI thread later updates the control at leasure. If you keep the front panel of a subVI closed, the front panel will typically not even be in memory, greatly reducing the memory footprint. Certain code elements (e.g. proerty nodes) force the front panel to be in memory, so avoid those!
Many times the data (e.g. halfway through a calculation) is uninteresting to the user, so it is important to only create front panel objects for the intersting stuff. One very efficient way is to keep large shared datasets is by using a data value references.
Some easy reading about memory and LabVIEW.
10-08-2015 10:39 PM
Thanks for pointing out this reference (in the LabVIEW Help) on Memory usage. I hadn't read it, and there's a lot of stuff in there I didn't know (as well as I thought I did).
BS