XControl and XObject
An XControl is a graphical object which usually displays information about variables on a server. An XObject is a server object which usually is linked to a screen object to display its values in a graphical format. When using an XControl and an XObject simultaneously, you expand the application flexibility.
XControl <-> XObject
As an example, let’s develop an XControl to the XObject EngineTag. The EngineTag is an XObject which was developed on the previous lesson to monitor the engine maintenance status, failure and speed. In case the engine is on failure, an alarm must be triggered.
Engine
Let’s develop an XControl which displays values from EngineTag in a graphical form.
Figure 1
- Insert a new XControl named
Engine
. - Insert an engine image (there are some images on the Motors group of the Gallery). The engine must blink in red and yellow to symbolize a failure.
- To change the failure status, let’s use a ToggleButton.
- Insert a Rectangle on the engine drawing to indicate if it is turned on or off.
- Insert a Display to show the RPM value and a Text to show the engine name.
- In the Properties tab of the XControl, create a property named Source of type EngineTag.
Figure 2
- In the Design tab, create a Bidirectional Link from the
Fail
button to the Source.Fail property.
Figure 3
- Select the engine image and create a Digital Link to change its color. It blinks in yellow and red when on failure, and gray when working properly.
Figure 4
- Create a Simple Link in the Display, to show the RPM property of the EngineTag.
Figure 5
- Create a Simple Link in the Text with the Name property of the EngineTag.
Figure 6
- Save and register the Library.
To use the XControl, follow these steps:
- In the
InitialScreen
, insert an Engine object for each existingEngineTag
on the Data folder. - Link every Engine object inserted on the Screen, in the Source property, with one
EngineTag
of the Data folder.
Figure 7
- Execute the application and test its functionalities.
Exercises
- Create an XControl for the XObject
MaintenanceTime
. - Create an XControl for the XObject
ValveTag
. - Create an XObject for the XControl
Speedometer
with the following requisites:
- Properties: Value, Minimum e Maximum.
- Alarm: when its value is different from 70% of the maximum, with a dead band of five units.
- Perform the modifications in the XControl
Speedometer
.
- Create an XObject for the XControl
Bottle
with the following configurations:
- Property: Level.
- Alarms: property Level less than 30 and greater than 70.
- The level value must be generated internally in the XObject (Tag Demo).
- Perform the modifications in the XControl
Bottle
.
- Create an XObject for the XControl
Controller
with the following configurations:
- Properties: Variable, Setpoint and Alarm.
- Alarms: when the Variable property is greater than SetPoint.
- Perform the modifications in the XControl
Controller
.