Jump to content

Connector pane: Difference between revisions

From LabVIEW Wiki
m Category reorg
 
(10 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Connector Panes  ==
{{TOCright}}
The '''Connector Pane''' is used to pass data to and from a [[SubVI]]. The Connector Pane is available in the [[Front Panel]] window's upper right corner next to the [[VI Icon]].


Connector panes are used in subVI's to pass parameters to and from the subVI. The connector pane is selected by right clicking on the VI icon in the upper right hand corner of your VI, then choosing the '''Show Connector''' menu item.  
== Patterns ==
Right-click on the Connector Pane to choose a pattern.  


[[Image:Show connector selection.png|thumb|center|300px|How to view the connector pane in a VI]]  
[[Image:Connector Pane Patterns.png|thumb|center|300px|How to select a connector pane pattern]]
 
It is considered good practice to choose a pattern that has more inputs/outputs than you need when writing the VI so that new inputs or outputs can be added without changing the connector pane and causing the VI's that link to your subVI to recompile. The 4x2x2x4 pattern highlighted above is the most commonly used for NI primitives. In [[LabVIEW 8]] and above the connector pane is defaulted to the 4x2x2x4 pattern. To customize the default connector pane used for new VIs, set the defaultConPane variable in your [[LabVIEW configuration file]] (see [[LabVIEW configuration file/Miscellaneous#defaultConPane|Miscellaneous>defaultConPane]]).
 
[[Image:ConPane.png|center|Connector pane values]]
 
=== Increase/Decrease Terminals ===
Right-clicking the Connector Pane and selecting '''Add Terminal''' or '''Remove Terminal''' effectively moves the pattern up or down one.
 
=== Changing Orientation ===
Right-clicking the Connector Pane and selecting '''Rotate 90 Degrees''', '''Flip Horizontal''', or '''Flip Vertical''' keeps the same pattern but changes the orientation.
 
== Connecting Controls and Indicators ==
To connect a control or an indicator to a terminal on the Connector Pane:
# Select the control or indicator
# Click on the desired terminal on the Connector Pane
 
== Switching Terminal Positions ==
To switch or move a control or indicator to a different terminal:
# Click on the terminal to move on the Connector Pane
# Hold-down ''Ctrl'' and click on a different terminal.  This will switch the two terminals, whether connected to something or empty.
 
== Disconnecting a Terminal ==
Right-click on the Connector Pane and select either:
* '''Disconnect All Terminals''' - to disconnect all terminals
* '''Disconnet This Terminal''' - to disconnect just the terminal that was clicked on
 
== Requirement Level ==
Right-clicking a terminal and selection '''This Connection Is''' presents four different options.  The terminals can be set to:
# '''Required''' - sets the input as required.  If the input is not wired, the program will not run, see [[Broken Run Arrow]].
# '''Recommended''' - sets the input as recommended.  If the input is not wired, the program will still run and the default value for control is used.
# '''Optional''' - sets the input as optional which is the same as recommended but the terminal will not appear in the [[Context Help]].
# '''Dynamic Dispatch Input (Required)''' or '''Dynamic Dispatch Output (Recommended)''' - Greyed out except for [[Class (object-oriented programming)|class]] inputs and outputs.  Sets the [[VI]] as [[Dynamic dispatch]].
 
== Index of Terminals ==
When using [[VI Scripting]] to access a Connector Pane (for example: [[ConnectorPane class/Controls() property|ConnectorPane class/Controls[] property]]), the terminals by defaultare ordered from Right to Left, Bottom to Top.  This changes if the pattern is rotated or flipped.  Therefore, for a standard 4x2x2x4 pattern the terminals are indexed as follows:
 
{{ConnectorPane|pattern=4x2x2x4}}
 
To see other patterns, see [[Connector pane patterns|Connector Pane Patterns]].
 
== Best Practices ==


Right-click again on the VI icon and choose a pattern for you subVI's connector pane.  
=== Terminal Organization ===
* Use the 4x2x2x4 pattern even if it leaves empty spaces.  Only go to patterns with more terminals if necessary.  However, before switching to more terminals, consider [[Bundle|bundling]] inputs or outputs into [[Cluster data type|Clusters]].
* Put inputs on the left side of the Connector Pane and outputs on the right.
* Use the bottom corners for ''[[Error Cluster data type|error in]]'' and ''[[Error Cluster data type|error out]]''.
* If the [[VI]] is a [[Method (object-oriented programming)|method]] in a [[Class (object-oriented programming)|class]], use the top corners as the class object input and output.


[[Image:Connector Pane Patterns.png|thumb|center|300px|How to select a connector pane pattern]]  
=== Require by Default ===
* Turn the flag in the [[Options dialog]] on which will require all inputs by default, except the ''error in''. This makes it so inputs to [[SubVI]]s don't get accidentally forgotten.


It is considered good practice to choose a pattern that has more inputs/outputs than you need when writing the VI so that new inputs or outputs can be added without changing the connector pane and causing the VI's that link to your subVI to recompile.
== History ==


The 4x2x2x4 pattern highlighted above is the most commonly used for NI primitives. In LabView 8 and above the connector pane is defaulted to the 4x2x2x4 pattern.  
{| class="wikitable"
! Version
! Change(s)
|-
|[[File:LV8-2013.png|frameless|border|64x64px|LabVIEW 2011|link=LabVIEW 2011]]
|In [[LabVIEW 2011]] the Connector Pane was changed to always be visible on the [[Front Panel]] window next to the [[VI Icon]]. [[LabVIEW 2010]] and earlier only the Connector Pane or the [[VI Icon]] was visible at a time and they were toggled between via a right-click menu ('''Show Connector''' or '''Show Icon''').


To customize the default connector pane used for new VIs, set the defaultConPane variable in your [[LabVIEW configuration file]] (see [[LabVIEW configuration file/Miscellaneous#defaultConPane|Miscellaneous>defaultConPane]]).  
Also, previously to [[LabVIEW 2011]], when creating a SubVI from a selection, the SubVI would be created with a varying pattern with just the number of inputs or outputs needed.  In [[LabVIEW 2011]] and later, the new SubVI will default to the 4x2x2x4 pattern, if the input/output count fits, and the errors will default to the bottom corners.
|}


[[Image:ConPane.png|center|Connector pane values]]
== See Also ==
* [[Front Panel]]
* [[Block Diagram]]
* [[VI Icon]]


[[Category:Calling a VI]]
[[Category:Calling a VI]]
[[Category:VI]]
[[Category:Connector Pane]]

Latest revision as of 12:04, 4 January 2025

The Connector Pane is used to pass data to and from a SubVI. The Connector Pane is available in the Front Panel window's upper right corner next to the VI Icon.

Patterns

Right-click on the Connector Pane to choose a pattern.

How to select a connector pane pattern

It is considered good practice to choose a pattern that has more inputs/outputs than you need when writing the VI so that new inputs or outputs can be added without changing the connector pane and causing the VI's that link to your subVI to recompile. The 4x2x2x4 pattern highlighted above is the most commonly used for NI primitives. In LabVIEW 8 and above the connector pane is defaulted to the 4x2x2x4 pattern. To customize the default connector pane used for new VIs, set the defaultConPane variable in your LabVIEW configuration file (see Miscellaneous>defaultConPane).

Connector pane values
Connector pane values

Increase/Decrease Terminals

Right-clicking the Connector Pane and selecting Add Terminal or Remove Terminal effectively moves the pattern up or down one.

Changing Orientation

Right-clicking the Connector Pane and selecting Rotate 90 Degrees, Flip Horizontal, or Flip Vertical keeps the same pattern but changes the orientation.

Connecting Controls and Indicators

To connect a control or an indicator to a terminal on the Connector Pane:

  1. Select the control or indicator
  2. Click on the desired terminal on the Connector Pane

Switching Terminal Positions

To switch or move a control or indicator to a different terminal:

  1. Click on the terminal to move on the Connector Pane
  2. Hold-down Ctrl and click on a different terminal. This will switch the two terminals, whether connected to something or empty.

Disconnecting a Terminal

Right-click on the Connector Pane and select either:

  • Disconnect All Terminals - to disconnect all terminals
  • Disconnet This Terminal - to disconnect just the terminal that was clicked on

Requirement Level

Right-clicking a terminal and selection This Connection Is presents four different options. The terminals can be set to:

  1. Required - sets the input as required. If the input is not wired, the program will not run, see Broken Run Arrow.
  2. Recommended - sets the input as recommended. If the input is not wired, the program will still run and the default value for control is used.
  3. Optional - sets the input as optional which is the same as recommended but the terminal will not appear in the Context Help.
  4. Dynamic Dispatch Input (Required) or Dynamic Dispatch Output (Recommended) - Greyed out except for class inputs and outputs. Sets the VI as Dynamic dispatch.

Index of Terminals

When using VI Scripting to access a Connector Pane (for example: ConnectorPane class/Controls[] property), the terminals by defaultare ordered from Right to Left, Bottom to Top. This changes if the pattern is rotated or flipped. Therefore, for a standard 4x2x2x4 pattern the terminals are indexed as follows:

Connector pane

To see other patterns, see Connector Pane Patterns.

Best Practices

Terminal Organization

  • Use the 4x2x2x4 pattern even if it leaves empty spaces. Only go to patterns with more terminals if necessary. However, before switching to more terminals, consider bundling inputs or outputs into Clusters.
  • Put inputs on the left side of the Connector Pane and outputs on the right.
  • Use the bottom corners for error in and error out.
  • If the VI is a method in a class, use the top corners as the class object input and output.

Require by Default

  • Turn the flag in the Options dialog on which will require all inputs by default, except the error in. This makes it so inputs to SubVIs don't get accidentally forgotten.

History

Version Change(s)
LabVIEW 2011 In LabVIEW 2011 the Connector Pane was changed to always be visible on the Front Panel window next to the VI Icon. LabVIEW 2010 and earlier only the Connector Pane or the VI Icon was visible at a time and they were toggled between via a right-click menu (Show Connector or Show Icon).

Also, previously to LabVIEW 2011, when creating a SubVI from a selection, the SubVI would be created with a varying pattern with just the number of inputs or outputs needed. In LabVIEW 2011 and later, the new SubVI will default to the 4x2x2x4 pattern, if the input/output count fits, and the errors will default to the bottom corners.

See Also