A VI which shows the differences between using a control/indicator, local variable and value property node to update a value.
When updating a graph you may need to position two cursors, change some colors, and write the data to the graph. In older versions of LabVIEW, this required two nodes: one for properties and another (Local Variable or Indicator) for the value. This resulted in two graph redraws. However, using a Value Property Node on the existing node instead of a Local Variable or Indicator will result in one less graph redraw, improving the performance of the code.
For controls that are updated very quickly (i.e. more than 50 times a second) Local Variables and Indicators have built in logic to alleviate and reduce the redisplays to save CPU cycles that would otherwise be spent redrawing objects unobservable to the human eye. The VI Snippet below will demonstrate the performance benefit of using a local variable instead of a property node for quick updates.
Steps to Implement or Execute Code
LabVIEW 2012 and later
Additional Images or Video
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
Thankyou for showing my #1 pet peeve with LabVIEW code I have seen. Once upon a time, NI saw a lot of race conditions due to people using local variables. So there came the mantra "Do not use local variables." So the brilliant people I worked with started using the value property node, not realizing why they were not to use local variables.
You may want to do some benchmarking code to show the actual time difference between the different update methods. My benchmarking caused some people to be in utter shock (the property node is over 2000x slower than the local and terminal).
A continuation of my though process of the previous post: A Look at Race Conditions