property nodes in LabView : tutorial 18




In this tutorial, you will learn about a feature named property nodes in LabView. Property nodes are used to change the visual properties of a control or an indicator using another control or indicator as you will see in detail in this tutorial. In the start you are provided with a brief introduction after that explanation using a VI is provided which help you to understand property nodes in detail. At the end of the tutorial you are provided with an exercise to do it by yourself, and in the next tutorials I will assume that you have done those exercises and I will not explain the concept regarding them.




Introduction to Property Nodes in labview

In LabView property nodes are used to make your program powerful and fun to work with. You can change or control the properties of front panel objects programmatically by using property nodes. With the help of property nodes you are allowed to programmatically change the color position visibility and display of almost all the controls and indicators on front panel during runtime. What does the word programmatically means here?? This means changing the properties of the objects present on the front panel using the objects already present on the front panel as you will see in detail in the example provide in the explanation section. One can change the color of a slide bar depending upon its present value using property nodes. You can also change the visibility of a control or an indicator depending upon other button or knob. You can also use a custom control to animate your front panels’ screen or to symbolize some physical process. These kinds of properties of front panel make the experience of the user even better

Exmaple of  property nodes in LabView 

  • Create a VI as I have explained to you in tutorial 1 and save it for future use by pressing <Ctrl+S>. If you want to create a property node you must first place a control on indicator whose property node you want to create. From the control palette on the front panel select Boolean and then select push button. Place the button on the front panel as shown in the figure below,property nodes in labview

Figure 1: Boolean button

  • On the corresponding block of push button on the block diagram window, click right a dropdown will appear, select create from the dropdown then select property node and a list of property nodes will appear as shown in the figure below,property nodes in labview

Figure 2: Placement of a property node




  • We will first use the visibility node from this list. The block of a visibility property node is shown in the figure below,property nodes in labview

Figure 3: Visibility node block

  • This block will allow you to change the visibility options of the block from which it is created. All the property nodes are set to read mode by default. If you want these nodes to control other blocks on the front panel you must change their mode to write. Right click on the visibility block and from the menu select change to write as shown in the figure below,property nodes in labview

Figure 4: Changing to write

  • This will create a pin at the input side of the visibility node. Right click on that pin and create a control as we have done in previous tutorials. Refer to the figure below,property nodes in labview

Figure 5: Visibility control

  • You can see that the control of which we created a property node was a Boolean, therefore the control you create to control the visibility of the main control will also be of type Boolean, as shown in the figure below,property nodes in labview

Figure 6: Control types

  • Run the VI continuously by using the run continuously button. You can see that when the visible button on the front panel is turned off. The main Boolean button will not be visible on the front panel as shown in the figure below,property nodes in labview

Figure 7: Running with visibility off

  • Now during the runtime if you press the visibility button and turn it on, the main Boolean button will also appear on the front panel as shown in the figure below,property nodes in labview

Figure 8: Running with visibility on

  • This is one property of a complete list that you can change programmatically. It is impossible to discuss all of the property nodes in one tutorial, I will, therefore, discuss a few of them and the rest is left for the reader as an exercise.
  • Now, expand the size of the property node you just created by using the size tool automatically generated from the tools palette as shown in the figure below,property nodes in labview

Figure 9: Size expansion

  • Place the cursor on the second block, using the finger tool click on the block and the property node list will appear again as shown in the figure below,property nodes in labview

Figure 10: Changing property node

  • For example we have chosen disabled property node, the block will be already be set to write if it is not then change it to write as we have done before. Create a control at the input side of the disabled block and arrange the blocks as shown in the figure,property nodes in labview

Figure 11: Block diagram with disabling node

  • Run the program continuously using the run continuous button. When the block of the disabled control on the front panel is set to enable, you can turn on and off the main Boolean block, as shown in the figure below,property nodes in labview

Figure 12: Enabled output

  • Now, from the selector of the disabled control, change the enable to disable as shown in the figure below, and try to push thr Boolean button this time. The VI will not allow you to push the button as the property node has already disabled the button.property nodes in labview

Figure 13: Disabled output

  • There is a third option in the disabled property node that is, disabled and grayed out. Change the selector option of the disabled block to disabled and grayed out, now the main boolean push button will be gray in vision and also disabled as shown in the figure below,property nodes in labview

Figure 14: Disabled and grayed output

  • You can still change the visibility option from the visibility button no matter how many additional property buttons are installed as shown in the figure below,property nodes in labview

Figure 15: Visibility with disabling property

  • The third property node I am going to discuss here is position control. Let’s change the position of the Boolean push button with the help of a pointer slide. On the property node again extend size of the node to one more block as shown in the figure below,property nodes in labview

Figure 16: Size extension

  • Change the property of the third block again by using the finger tool and select position and from the submenu select left as shown in the figure below,property nodes in labview

Figure 17: Changing property to position

  • Now on the front panel from the control palette select numeric and then select horizontal pointer slide as shown in the figure below,property nodes in labview

Figure 18: Pointer slide

  • Now, change the upper and lower limits of the pointer slide according to the current position of the main Boolean block as shown in the figure below,property nodes in labview

Figure 19: Changing limits of pointer slide

  • Connect the corresponding block of the slider on the block diagram window to input side of the position property node and the resulting block diagram is shown in the figure below,property nodes in labview

Figure 20: Diagram with position property

  • Now, run the program continuously using the run continuously button and change the position of the pointer slide this will change the position of the main Boolean block also. See the figure below,property nodes in labview

Figure 21: Position control output

  • Varying the position of the pointer slide will vary the position of main Boolean block correspondingly as shown in the figure below,property nodes in labview

Figure 22: Varied position

Exercise:

  • Explore the remaining properties of property nodes that you can change programmatically.

<< Previous article                                                     Next article>>




Add Comment