Editing the Facade VI in LabVIEW
We add LabVIEW controls and indicators to the Facade VI to create the front panel of the XControl. By default, the Facade VI includes data, display state, and container state controls and data, display state, and action indicators. These controls and indicators are hidden and are not part of the XControl appearance. We should resize the front panel window to fit only the controls and indicators that make up the appearance of the XControl. We can set the window appearance properties of the Facade VI to adjust the size and appearance of the XControl.
The block diagram of the Facade VI handles events for the front panel controls and the Facade VI itself. It contains a While Loop with an Event structure in it. The Facade VI is not a continuously running VI.
LabVIEW calls the Facade VI only when there is an event pending for the VI to handle. LabVIEW calls the Facade VI with the current data, display state, and container state. The VI handles the event and returns the updated data, display state, and type of action performed.
We can use the Container State cluster to provide information about the instance of the XControl. The Container State cluster includes three elements—Indicator?, Run Mode?, and Refnum. We can use Indicator? to determine if the XControl instance is a control or indicator. We can use Run Mode? to determine if the VI we are using the XControl it is running or idle. Run Mode? is set to TRUE when the owning VI is running.
Refnum is a reference to the XControl instance that we use only to query information about the XControl. We should not use Refnum to modify the XControl instance from the Facade VI.
When the Facade VI changes the data or display state, it should update the Action cluster and inform LabVIEW of the changes. The Action cluster contains three elements—Data changed, State changed, and Action name. We should set Data changed to TRUE when the Facade VI changes the Data Out indicator. We should set State changed to TRUE when the Facade VI changes the Display State Out indicator. Optionally, we can use Action name to name the action being performed. This name appears when we select the Edit - Undo option. Typically, the Facade VI changes the data or display state in response to events generated on the front panel controls.
Watch the entire LabVIEW tutorial series here;
• NI LabVIEW - How to Use View Menu?
Watch the entire TestStand video learning series here;
• NI TestStand Documentation and Resources
#LabVIEW #EditingFacadeVI #FacadeVI