In my LabVIEW program, I want to assign controls by using local variables, or using references couple with property nodes. Which one costs less computer resources?
The local variables cost less computer resources.
A local variable only accesses the value property of the control. While a reference couple with a property node accesses all the properties of the control. Therefore, the local variable costs less computer resources.
Here is a test. Both the consuming time and the memory usage of the local Variable testing VI is less than that of the reference testing VI.
Fig. 1. Using Local Variable
Fig. 2. Using Reference couple with property nodes
When programming a large program, using references packed into a cluster is a method to make the program clear and easier to read. If your program is relatively large, and you don't have to continually assign the controls, using the references is a better choice.
Thank you for your feedback.
You changed your response to Not Helpful
You changed your response to Helpful
Control/Indicator, Local Variable, and Value Property Node Differences
Collaborate with other users in our discussion forums
A valid service agreement may be required, and support options vary by country.