Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Selecting the Instance of a Polymorphic VI Manually

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

When you place a polymorphic VI on the block diagram, the default polymorphic VI is the first instance in the Instance VIs list of the Polymorphic VI window. When you create a control, indicator, or constant from the polymorphic VI terminals, the instance determines the data type of each object. To change the default instance, use the arrow buttons in the Polymorphic VI window to move a selected instance in the Instance VIs list to the top of the list.

For most polymorphic VIs, the data types you wire to the inputs of the polymorphic VI determine the instance to use. For example, if you wire a string constant to the default value input terminal of the Read Key VI, LabVIEW selects the String instance of the polymorphic VI, and the value output terminal changes to a string data type.

If the data types you wire to the polymorphic VI inputs do not determine the instance to use, you must select the instance manually. If you manually select an instance of a polymorphic VI, the VI no longer behaves as a polymorphic VI because it accepts and returns only the data types of the instance you select.

Use the following ways to select the instance of a polymorphic VI manually. For built-in polymorphic VIs, the Context Help window displays a description of each instance as you move the cursor through the shortcut menus.

  • Right-click the polymorphic VI on the block diagram, select Select Type from the shortcut menu, and select the instance to use.
  • Use the Operating tool to click the polymorphic VI selector and select an instance from the shortcut menu. Right-click the polymorphic VI on the block diagram and select Visible Items»Polymorphic VI Selector from the shortcut menu to display the selector. The following illustration shows an example of a polymorphic VI selector.

To change the polymorphic VI to accept all the handled data types again, right-click the polymorphic VI and select Select Type»Automatic from the shortcut menu, or use the Operating tool to click the polymorphic VI selector and select Automatic from the shortcut menu.

Tip  To find the polymorphic VI node associated with a polymorphic VI selector, right-click the selector and select Find Polymorphic VI from the shortcut menu.

 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit