2.1.4. String Substitutions

  • Overview: String substitutions.
  • Configuration: String substitution.

Overview: String Substitutions

String substitutions provide the capability to customize text values at the object level.

String Substitution Sources

Sources for string substitutions are available for the following.

  • All class attributes.
Note: If an attribute is not initially a text type, it is treated as a text type when it is used as a string substitution.
  • CIMPLICITY predefined variables, which are:
Variable Description Example (When Instantiated)
$OBJECT Object ID STATION01
$ID ID of the data item LEVEL.
$CLASS Class ID TANKS

Limitations: String substitution

Nested substitution is not supported.

Example

You have created the following variables:

VAR1="{VAR2}"

VAR2="HELLO WORLD."

You enter the string substitution {VAR1}

The expression after substitution will be the string "{VAR2}".

The expression will not be reevaluated to yield the result "HELLO WORLD."

Configuration: String Substitution:

A Class: Data item configuration
B Object: Object defined.
C Instantiation: Point properties result.
  1. Class: Data Item Configuration

Enter string substitutions in any of the following fields in a Data Item dialog box.

Use brackets {} to enclose substitution entries.

Data Item Type Fields Supporting String Substitution
All Description Safety Point Screen Availability Trigger Measurement Units Label
All Analog and Boolean Point Enumeration
Derived Expression Reset Point
Device Address Device ID
Point Alarm Alarm Message Alarm Class Deviation Point
Text Initialization value

Example

The description for a LEVEL data item that is entered in the Description field on the Data Item dialog box>General tab includes two string substitutions.

The description is as follows.

{$OBJECT} level in {LHIGHCRITICAL} gallon water heater.

Where

{$OBJECT} is the CIMPLICITY predefined variable.

{LHIGHCRITICAL} is a custom analog attribute for the Alarm High value.

  1. Object: Object Defined

String values can be entered in the Object dialog box.

Object Created

Class objects are created from the class.

Example

A class object created from the class TANKV is named: STATION04.

Attribute Value Assigned

Values that are entered in the fields created from the class attributes will replace the string substitution attributes entered in the Data Item dialog boxes.

Example

A class object created from the class TANKV is named: STATION04

Values will replace the string substitutions that were entered in the LEVEL Data Item dialog box>Description field are the following.

String Substitution Value
1 ($OBJECT) STATION04
2 (LHIGHCRITICAL) 5000
  1. Instantiation: Point Properties Result

Fields in instantiated Point Properties dialog boxes display instantiated values for string substitutions. Fields that display some substitutions continue to be enabled so they can be edited at the instantiated point level.

Example

The Description field in the instantiated STATION04.LEVEL Point Properties dialog box displays the substituted values. The field is read-write so these values can be changed.

String Substitution Value
1 ($OBJECT) STATION04
2 (LHIGHCRITICAL) 5000