LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

initialization methods.

I saw many examples in LV.
I am very wondering why a property node could be used in initialization.
In my rough thinking, it may be okay if a=0 in the first stage.
What is the advantage of using a property node? 
0 Kudos
Message 1 of 5
(2,991 Views)
A property node allows you to set not only the value of a variable, but also the attributes of the object.
The property node is a very interesting and powerfull tool.

We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 2 of 5
(2,978 Views)
I'm don't really understand your question ("why a property node could be used"? Because.), but usually initialization is done where needed or where it's convenient to the user. Another option for initialization is to use the Make Current Value Default option, which will reload this value every time you open (not run) the VI.
 
In general, you should avoid using value property nodes. Instead, use local variables, which are more efficient. As for the other things you can do with property nodes, have a look at this [broken link removed] tutorial for some details.
 
To learn more about LabVIEW, I suggest you try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
In addition, I suggest you read the LabVIEW style guide and the LabVIEW user manual (Help>>Search the LabVIEW Bookshelf).

___________________
Try to take over the world!
0 Kudos
Message 3 of 5
(2,964 Views)

Initializing using a property node is useful when you wish to set a value of a control in a subvi.  I have done this where an initialize subvi takes the references to some controls on a GUI main panel and sets their values depending on a state of the system.  Although using locals are more efficient than property nodes, the use of a subvi makes the code very clean looking.  The issue with reinitialize to default is that the default value is fixed and initial values (such as user preferences, last run values ...) can change with time.  Yes there is a performance issue, but initialize functions usually are not too concerned with milliseconds.  If this is for DAQ systems or real-time then locals are the way to go.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 5
(2,946 Views)

One other useful reason for writing a value to a control through a property node is when the control has a value change event that you want to file, you can use the value(signal) node.  Here you can update the value and signal the value change event, very useful in GUI event systems which require a value to be changed from both a user event and a programatic event.

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 5
(2,945 Views)