2.2.4. Data Item: Additional Expression Examples
- Example: Alarm Enable
- Example:
$DATA_ITEM_EXISTS
Example: Alarm Enable
Note: When the enable state fields are included for a data item, an object designer can enable/disable the included alarm levels for each object.
The instantiated analog point for a data item named LEVELEXP requires:
- Four alarm states for some objects.
- Alarm High and Alarm Low states only for other object.
A | Class: Data item configuration. |
B | Object: Object defined. |
C | Instantiation: Point properties result. |
- Class: Data Item Configuration
Two analog attributes are created that will display as fields in the Object dialog box.
The attributes are as follows.
![](../common/../images/VDialogAttributeWARNHIGHON.png)
Field ID | Field Name for Attribute Dialog Box | |
A | $WARNING_HIGH_ENABLED | WARN HIGH ON |
B | $WARNING_LOW_ENABLED | WARN LOW ON |
Field ID's are assigned to the LEVELEXP data item.
![](../common/../images/VDialogDataItemExpressionWARNHI.png)
Field ID | Expression Example | |
A | $WARNING_HIGH_ENABLED | WARNHIGHON analog attribute. |
B | $WARNING_LOW_ENABLED | WARNLOWON analog attribute. |
- Object: Object Defined
Two objects are defined in the TANKV class.
STATION05
One object, STATION05, requires all alarm states.
A value that is greater than 0 is required to enable the alarm states.
1 is entered for each
![](../common/../images/VDialogObjectSTATION05WarnHiLow1.png)
STATION04
One object, STATION04, requires only the Alarm High and Alarm Low alarm states.
The value 0 is required to disable the alarm states.
0 is entered for each
![](../common/../images/VDialogObjectSTATION04WarnHiLow0.png)
- Instantiation: Point Properties Result
The alarm state values for the instantiated points reflect the entries in the Object dialog box.
STATION05
STATION05.LEVELEXP has four enabled alarm states.
![](../common/../images/VDialogPointPropertiesSTATION05AlarmStates4.png)
STATION04
STATION04.LEVELEXP has Alarm High and Alarm Low only enabled.
![](../common/../images/VDialogPointPropertiesSTATION04AlarmStates2.png)
A data item can be included or excluded from being instantiated into a point based on the expression in an assigned $DATA_ITEM_EXISTS
field ID.
Example: $DATA_ITEM_EXISTS
A class includes data items, that will be instantiated into points based on which control valve is selected for an object.
The data items require the following control valves.
Data Item | CVALVE01 | CVALVE02 | CVALVE03 |
TANK01 | X | ||
TANK02 | X | ||
TANK03 | X |
One data item will be instantiated into a point for each object; the data item that is instantiated depends on which valve is selected for that object.
A | Class: Data item configuration. |
B | Object: Object defined. |
C | Instantiation: Point properties result. |
- Class: Data Item Configuration
In the class configuration data items will be assigned to the same attribute.
Attribute Created
An analog attribute, CVALVE
, is created that will be used to identify the Valve that should be selected for each data item.
![](../common/../images/VDialogClassTANKSAttributeCVALVE.png)
Data Item Configuration
Three TANK data items are created.
The first data item, TANK01 is assigned $DATA_ITEM_EXISTS
, with the following expression to associated Control Valve 1 with TANK01.
![](../common/../images/VDialogExpressionDATAITEMExist01.png)
Field | Example Value Assigned | |
First operand | Attribute ID | CVALVE |
Operator | = | |
Second operand | Number | 1 |
Two additional data items are assigned the field ID, $DATA_ITEM_EXISTS
.
The three data items and expressions for $DATA_ITEM_EXISTS
are as follows.
Data Item | $DATA_ITEM_EXISTS Expression |
TANK01 | CVALVE=1 |
TANK02 | CVALVE=2 |
TANK03 | CVALVE=3 |
- Object: Object Defined
2 is entered in the CONTROL VALVE field for an object, STATION02.
![](../common/../images/VDialogATTRIBUTECVALVE.png)
- Instantiation: TANK Points Existing
TANK02 is instantiated for the STATION01 object.
TANK01 and TANK03 do not exist for that object.
![](../common/../images/VWorkbenchPointsDataExistSTATION02.png)