Creating Properties and Methods

Properties are attributes of a VI, object, or application. Methods perform actions on a VI, object, or application. Use a Property Node to get or set a property of a specific VI, object, or application. Use an Invoke Node to perform an action, or method, on a specific VI, object, or application.

You can create multiple properties and methods for the same VI, object, or application.

Complete the following steps to create a property or method using a Property Node or Invoke Node, or use one of the alternative ways to create a property or method.

  1. Determine for which object you want to create a property or method. Obtain a reference to that object in one of the following ways:
  2. Determine whether you want to create a property or a method.
  3. Wire the reference to the object to the reference input of the node. The node automatically changes to show the class of the object that you wired to it. Different classes of objects have different properties and methods available to them.
    Note Note  If you want to create a property or method for the current application or VI, you do not have to wire data to the reference input of the node because LabVIEW uses the current application or VI by default. However, you must manually select either the Application or VI class by right-clicking the node and selecting Select Class from the shortcut menu.
  4. To select the specific property or method to use, click the white area of the node and select the property or method from the hierarchical menu that appears.
  5. (Optional) Property Nodes allow you to get or set multiple properties with the same node. To add more properties to the same Property Node, right-click the white area of the node and select Add Element from the shortcut menu or use the Positioning tool to resize the node.
  6. (Optional) To change a property from read to write, right-click the property and select Change to Read or Change to Write from the shortcut menu.
  7. If the Property Node returns a reference or an array of references to an object, use the Close Reference function to close the reference.

     Add  Find
Note  If you add a property to a While Loop or For Loop and the property returns a reference to an object, you must close that reference for each iteration of the loop. You can move the property outside the loop and close the reference after all iterations of the loop execute.

Alternative Ways to Create Properties and Methods