XControls abilities are components of the XControl that the XControl requires to function properly. Abilities are represented by VIs or controls (.ctls) that LabVIEW calls at the appropriate time. Required abilities define the appearance, data type, display state, and initialization of the XControl. XControls include the following required abilities:
Data—Data is a type definition VI that specifies the data type of the XControl. Double-click the Data ability in the XControl library to open and edit the Data type definition. By default, the Data type definition includes a numeric control. Replace the existing control in the VI with a new control that represents the data type of the XControl. Save the Data type definition after you make the changes.
State—State, also known as display state, is a type definition VI that specifies any information other than the data of an XControl that affects the appearance of the control. At any point in time, the XControl uses the Data and State abilities to update its appearance. Double-click the State ability in the XControl library to open and edit the State type definition. By default, the State type definition includes a cluster with a numeric control. Replace the existing control in the VI with a new control that represents the display state of the XControl. Save the State type definition after you make the changes.
When the type of display state changes, use the XControl Properties dialog box to update the version of the XControl. If the version has changed, you can use Init to update the State ability.
Facade—Facade defines the appearance of the XControl. The Facade ability is represented by the Facade VI. The front panel of the Facade VI defines the appearance of the XControl. The block diagram of the Facade VI describes the behavior of the XControl. Double-click the Facade ability in the XControl library to open and edit the Facade VI. Save the Facade VI after you make the changes.
Init—LabVIEW calls the Init ability when the XControl is first placed on a front panel or when a VI that contains the XControl is loaded into memory. Use this ability to initialize the display state before the XControl is displayed.
The Init ability also plays an important role in updating previous versions of the XControl to the latest version. When you load a VI that contains an XControl, LabVIEW calls Init and checks if the version of the XControl has changed since the last time the VI was saved. If the version has changed, you can use Init to update the State ability.
Init includes Previous Version and Previous State controls and a Current State indicator. When the version changes, Init converts the value of Previous State, which is passed in as a variant, to the new state format. The new state is passed to the Current State indicator.
An XControl can have additional, optional abilities. The Select Ability dialog box lists and describes all required and optional abilities that are applicable to the XControl.