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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Difference between value change in property node and local variable

Hello 

 

i was going through the property node and i found out the value change function in it. i saw some tutorials and i think its function is very similar to local variables.

 

Pl correect me if i am wrong. could someone explain the differences as well

 

regards

 

jalashwa

0 Kudos
Message 1 of 6
(2,805 Views)

Hi. They perform basically the same function although performance is slightly different.

The VI in this link demonstrates the difference ...

http://www.ni.com/example/27031/en/

 

 

Message 2 of 6
(2,778 Views)

What Neil said. Short answer is to always use a local as it's faster. The 'value(signaling)' property has its own uses, but again never use this unless you have a specific reason. (It triggers front panel events which is only of use on some occasions when you are using event structures.

 

In a nutshell, use a local in preference unless you have a specific reason not to.

0 Kudos
Message 3 of 6
(2,769 Views)

NeilR wrote:

The VI in this link demonstrates the difference ... http://www.ni.com/example/27031/en/


Wow, that's a horrible example! Who wrote this thing??? 😮

 

  • Stacked sequences
  • hidden wires
  • hidden code
  • several representation mismatches
  • unreasonable default value
  • no outer while loop, forcing continous run.
  • ...

There are plenty of long discussion here in the forum, try a search. (Here's even a very old benchmark)

0 Kudos
Message 4 of 6
(2,741 Views)

This is one of those pet peeves of mine.  At one point in time, NI just said "Don't use local variables".  But never explained (well) why or what to use as an alternative (like WIRES or SHIFT REGISTERS).  So I had a bunch of coworkers, instead of using local variables, would use the Value property node.  Then I went on a crusade.  In the bechmarks I made at that time, the property node was a good 10x slower (if not more) than local variables.  The reason for this is that the property node forces a thread swap since property nodes that affect the front panel must run in the UI thread.

 

The Value (Signaling) property is useful if you need to cause the event structure to respond to you programmatically changing a value.  But you need to be careful because, even if you didn't change the value, the event will be fired each time the property is written to.  You are generally better off using User Events anyways.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(2,733 Views)

NeilR wrote:

The VI in this link demonstrates the difference ... http://www.ni.com/example/27031/en/


Wow, that's a horrible example! Who wrote this thing??? :smileysurprised:


 

Don't know, but NI seem to think it's good enough to post as an example. Smiley Very Happy

 

But seriously, you're right Sir A, examples should be of a high quality and demonstrate good coding style and functionality.

 

Maybe we need to get the select few members of 'The NI Round Table' to do some judicious editing.

 

0 Kudos
Message 6 of 6
(2,722 Views)