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.
01-26-2014 04:48 AM
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
01-26-2014 08:21 AM
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/
01-26-2014 09:14 AM
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.
01-26-2014 12:18 PM - edited 01-26-2014 12:19 PM
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??? 😮
There are plenty of long discussion here in the forum, try a search. (Here's even a very old benchmark)
01-26-2014 12:27 PM
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.
01-26-2014 01:13 PM
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???
Don't know, but NI seem to think it's good enough to post as an example.
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.