LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"Property Nodes.vi" Example - Questions

Hello everyone.

I'm new at LabView, so please bear with me. I've been confused about the purpose and meaning of "Property Nodes" and I have failed to find any satisfactory tutorials on the subject. Instead, I tried studying "Property Nodes.vi" that is an example supplied by NI.

As you can see, there's three examples in this single file. I have questions regarding all three:

First from the left) I understand that you create a numeric first, then make a property node from the numeric. You can then create a text control which is wired to the property node. However, how does go about creating the different states "Disabled", "Enabled", and "Disabled and greyed out"?

Second) Am I right to think that the select function receives either a reference to the Boolean or a reference to Numeric 2, depending on T/F of the control selection? Also, what does the property node on the right do and how do I create it? Why is it titled "Ctl"?

Third) The third example I fail to understand at all. Of course I see that the chart is made on the leftmost side and it's reference is sent to a SubVi. However, when I go to the subVI, I am confused. How does one create a Property Node like that (which includes creating entires such as "XScaleMaximum")?

Thank you,
Alex
0 Kudos
Message 1 of 5
(3,233 Views)
Property nodes allow you to change the characteristics of a front panel element or the VI. Invoke nodes allow you to perform actions on front panel elements. Each front panel element (as well as the VI itself) has a set of properties that you can read or write at run-time to affect the behavior and/or appearance of the element. The "Disabled" property is one such property. You can right-click on a front-panel control and select its disabled state in edit mode, but you can do the same at run-time with the property node.

With respect to your questions:

First from the left) I understand that you create a numeric first, then make a property node from the numeric. You can then create a text control which is wired to the property node. However, how does go about creating the different states "Disabled", "Enabled", and "Disabled and greyed out"?

I do not understand what you are referring to by "create a text control which is wired to the property node". You cannot wire a control to a property node. A property node is linked to a control. As for the "Disabled" state, this is a numeric value. If you have the Context Help window open and you hover the mouse over the node element, the Context Help will provide some short help on that property:

This tells you that you wire a number, and the value indicates the "disabled" state.


Second) Am I right to think that the select function receives either a reference to the Boolean or a reference to Numeric 2, depending on T/F of the control selection? Also, what does the property node on the right do and how do I create it? Why is it titled "Ctl"?

To the first question: yes.
To the second question: That node does the same thing as the other "Disabled" property node. The difference is that in the first one the property node has a static link to the front panel element. This is why there is no control reference input. That's because the node already knows which front panel element it belongs to. The one that you're referring to is a "generic" property node. You wire a reference to a control and then the node will act on the control that you wire to it. This allows you to programmatically select which control to act upon. In that example, the Boolean control allows you to select which control to disable. That "generic" property node is found in the "Application Control" palette.


Third) The third example I fail to understand at all. Of course I see that the chart is made on the leftmost side and it's reference is sent to a SubVi. However, when I go to the subVI, I am confused. How does one create a Property Node like that (which includes creating entires such as "XScaleMaximum")?

The answer to this is actually from my last statement for your second question above. In the "Application Control" palette there are Property Node and Invoke Node elements. When you plop them down on the block diagram you need to wire a reference to a front panel element to them so they know what to act upon. With control references there is sometimes the additional option of including the datatype within the reference. When this is done you will see a red star on the control reference icon on the front panel, and the property node will have the text "(strict)" in the yellow header, as that one in the subVI has. The datatype is used primarily if you access the "Value" property. If the datatype is known, then the color of the "Value" property will reflect the datatype. Otherwise, it will be of type "variant".

0 Kudos
Message 2 of 5
(3,218 Views)
In addition to Smercurio's answer, you can visit this link to see an overview of all the VI-server classes, as you can see the Control class is part of a bigger hierarchy.
The control class itself has several general properties and methods that are valid for all of it's children. If you have a function where several different classes merge (like with the choose function in the example) the LabVIEW compiler will typecast them to the most common parent.
Some of the control are not directly used in LabVIEW (Named numeric for instance) those are used to group several alike classes.

VI-server with all it's properties and methods is a very powerful part of LabVIEW and the G language.

Ton
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 3 of 5
(3,214 Views)
Thank you for your responses.

I'm still having some trouble with the third case. In particular, how does one create "CTRL Reference" in the subVI?
0 Kudos
Message 4 of 5
(3,171 Views)
A control reference can be created from the control-pallettes:
Modern->Refnum->Control Refnum



Then you can edit the type of control by right-clicking and selecting 'Select VI server class'.

Ton


Message Edited by TonP on 07-01-2008 06:26 AM
Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
0 Kudos
Message 5 of 5
(3,152 Views)