09-21-2006 06:41 AM
What is difference between local variable and property node ?
09-21-2006 06:52 AM - edited 09-21-2006 06:52 AM
To put it in simplest functional terms
Local variable can be used to read data that a control/indicator contains, or write data to that control/indicator
Whereas with a property node, you can do this operation as well as set/query all the associated properties of that contol/indicator ( like make that object invisible, disabled, assign a label name and lot more that you have to explore to know)
Message Edited by devchander on 09-21-2006 06:56 AM
09-21-2006 07:52 AM
To expand slightly on devchander's response, local variables can be used to read/write a control's value if you don't have access to the terminal for the control on the diagram.
Property nodes can be used for the same thing (using the Value property) as well as many other things, as devchander mentioned.
However, if your goal is simply to read/write the value of the control, local variables are more efficient than property nodes (though still not as efficient as using shift registers and wires).
09-21-2006 08:19 AM
09-21-2006 09:15 AM
JLV,
Why would property nodes be more susceptible to race conditions?
A problem I have with locals is size. If you have a control with a long name - the local gets huge and takes up a lot of screen space. It would be nice if locals were a standrd size and identified by their label on the block diagram instead of embedding the label in the local itself.
Bill F
09-21-2006 09:31 AM
09-21-2006 09:32 AM
hi there
-"Why would property nodes be more susceptible to race conditions?" property and invoke nodes have error inputs/outputs. this allows you to create a dependency in execution by wiring the error clusters. with locals you have to use sequence structures ore something like that to force a dependency.
- locals create data copies! so if you store lots of data in your controls memory may be an issue! property nodes don't create data copies.
- you should always seperate naming for the GUI from the naming on the block diagram. for the GUI use the "caption", for the diagram the "label". the locals name is the controls label.
- one of the most efficient ways to transport data through your app is the usage of "Functional global variables" aka "LV2 style globals". search here for this keywords. this dosn't use either locals nor property nodes.
09-21-2006 09:41 AM
Thanks chris,
You described it very well..
@JoeLabView wrote:
Local Variable may be more susceptible to them.
I thought I mentionned Locals.. I try to avoid them as much as possible. I recently discovered that they are indeed useful when dealing with IMAQs. However, as Chris described, there is no dependencies and they are resource hungry..
Actually, in the Basics course, there is an example of race conditions that occur when using Local Variables.
RayR
09-21-2006 10:06 AM
09-21-2006 10:41 AM