07-23-2025 09:26 AM
I haven't had the chance to program much LabVIEW during the previous years but worked intensely with it in the far past (and even passed the "developer" exam). Regarding property nodes vs. local variables: I remember the recommendation to prefer property nodes over local variables. Give me a hint: Why could local variables be favourable? Wasn't it the memory argument? Which one of the two options uses less memory?
07-23-2025 10:19 AM - edited 07-23-2025 10:19 AM
@Ljewin wrote:
I remember the recommendation to prefer property nodes over local variables. Give me a hint: Why could local variables be favourable? Wasn't it the memory argument? Which one of the two options uses less memory?
Nobody sane ever suggested that value property nodes are preferred over local variables. You probably heard that local variables cause extra memory copies (completely irrelevant for scalars) and extrapolated from there, but property nodes are significantly worse because they also execute synchronously and force a thread switch.
(Value property nodes are useful of you want to change a value from within a subVI that has a control reference as input, but they have little usefulness within the same diagram)
LabVIEW is a dataflow language and the wire is the variable. You can always tell where the value comes from and what depends on it downstream. One you break dataflow with locals and value property node you never know what part changed the value last and race conditions can occur.