Рет қаралды 1,146
Using XControl Abilities in LabVIEW
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:
1- Data - Data is a type definition VI that specifies the data type of the XControl. We can 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. We can replace the existing control in the VI with a new control that represents the data type of the XControl. We can save the Data type definition after we make the changes.
2- 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. We can 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. We can replace the existing control in the VI with a new control that represents the display state of the XControl. We can save the State type definition after we make the changes.
When the type of display state changes, we can use the XControl Properties dialog box to update the version of the XControl. If the version has changed, we can use Init to update the State ability.
3- 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. We can double-click the Facade ability in the XControl library to open and edit the Facade VI. We can save the Facade VI after we make the changes.
4- 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. We can 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 we 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, we 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.
Watch the entire LabVIEW tutorial series here;
• NI LabVIEW - How to Us...
Watch the entire TestStand video learning series here;
• NI TestStand Documenta...
#LabVIEW #UsingXControlAbilities #XControl