Object description texts

Object description texts are used to create a unique name for all objects in the project structure. (This is called DPAD or BAS (user address key))

Each level within the project structure is given a name and a description text.

The concatenation of the partial names from the project structure results in the name and description text of an object. Concatenated texts are created using placeholders or labels.

The following object parameters are summarized as texts:

The texts of a object are generated automatically only if a placeholder is included. This is typically the case when the PLC starts for the first time.

Object description texts 1:

Since from now on all texts have a defined value (which is also saved persistently), they will no longer be generated again!

From this point on, texts can only be changed by the user!

Labels

A Label FB (e.g. in a GVL) can be used in the declaration of one or more objects to generate its texts automatically.

A distinction is made between the following label types:

Any (simple or dual) label can be assigned to each object.

Each view should be assigned a simple label which is interpreted as aggregate information. Function information is not supported by views.

Programming

Placeholder

Placeholders represent a value that will be generated later. For example, the ObjectName and Description parameters are initialized with standard placeholders as follows:

During object initialization, the text generation mechanism analyses a text for defined placeholders.

Only if a valid placeholder exists, the mechanism can replace it with an automatically generated text. On the other hand, a manually defined text would have replaced a placeholder and would not be overwritten.

As soon as the texts are generated, variables no longer contain placeholders.

Even if the device is restarted and parameters (persistent variables) have been saved, the current texts remain (automatically generated, manually defined or even changed by an operator at runtime) and are not overwritten by the text generation mechanism.

Purpose of use

Indexing

Object description texts 2:

Manually defined indices (regardless of the purpose) are always displayed in the generated text.

Object description texts 3:

A given index is also automatically used for parameters of subsequent objects if they do not also explicitly define an index.

Sample:

As an index of 10 is defined for Pump1, index 11 is automatically used for Pump2.

Pump1 : FB_BA_View := (iLabel:=SomeLabel, sObjectName := '{Idx=10}');

Pump2 : FB_BA_View := (iLabel:=SomeLabel);

Manually assigned indices must be assigned carefully as they are not validated by the mechanism!

Concatenation

The texts of an object are concatenated with texts of parent objects under certain conditions:

Use cases

Parameter

Parameter

Shortcut

Event Transition Text

EvtTrans

Present Value

PrVal

Device Type

DevType

Instance ID

InstID

Object Name

ObjName

Description

Descr

Attributes

Attributes are typically used in the application (for example, in a template) because the application-specific details are known there, but not the operator-specific details.

Attributes

Shortcut

Type

Aggregate Index

Idx

Unsigned number

Function Index

Idx

Unsigned number

Syntax

Samples

Parameter ObjectName with defined placeholder (concatenates automatically generated values):
sObjectName := '{}'

Concatenates parameter ObjectName with overwritten value:
sObjectName := '{AAA01_BB01}'

Concatenates parameter Description with placeholders and predefined additional information that is not replaced:
sDescription := '{} North'

Concatenates parameter Description with a placeholder and extends a substitute index attribute (the index value of the ObjectName is transferred):
sDescription := '{Idx}'

Concatenated parameter ObjectName with placeholder including defining index attribute:
sObjectName := '{Idx=10}'

Concatenated parameter ObjectName with placeholder including substitute (aggregate) and defined (function) index attribute:
sObjectName := '{Idx,Idx=10}'

Concatenated parameter Description with overwritten value and a defined (function) index attribute:
sDescription := '{Pump{Idx=5}}'

Concatenated parameter Description with placeholder and a substitute parameter:
sDescription := '{} - ID {InstID}'

ObjectName with default placeholder but without concatenation (concatenation denied):
sObjectName := '!{}'

Concatenated parameter ObjectName with overwritten value, but without index attribute (attribute denied):
sDescription := '{PU{!Idx}}'

Error messages

Name

Text

Description

[T23]

Internal error on parsing placeholder "...": Defined value and attributes at once!

Defining placeholder values and attributes at the same time is not allowed, because a Defined value prevents attributes from being applied.

Generating texts

The following sequence is used to decide how a placeholder is replaced:

  1. Overwrite texts
    If defined, a manually initialized title is used:
    fbSensor : FB_BA_AO_IO := (sObjectName:='Tmp03', sDescription:='Temperature sensor 3');
  2. Labels
    If titles are not overwritten, a label can be applied:
    SomeLabel : FB_BA_Label := (sName:='PU', sDescription:='Pumpe');
    Pump : FB_BA_View := (iLabel:=SomeLabel);
  3. SymbolName
    If nothing is defined, the following default values are used:
    • ObjectName receives the information from the symbolpath.
    • Description receives the information from the symbolname.

Samples

Initialization by means of labels

Transfer of the texts defined in the label to objects.

{region 'Labels in GVL "MyLabels"'}
  MV    : FB_BA_Label    := (sName:='MW',  sDescription:='Messwert');
  TFl    : FB_BA_Label    := (sName:='TFL',  sDescription:='Vorlauftemperatur');
  TRt    : FB_BA_Label    := (sName:='TRL',  sDescription:='Rücklauftemperatur');
  PreHtr    : FB_BA_Label    := (sName:='LE',  sDescription:='Lufterhitzer');
     
  TFl_MV    : FB_BA_Label2x    := (iAggregate:=TFl,  iFunction:=MV);
  TRt_MV    : FB_BA_Label2x    := (iAggregate:=TRt,  iFunction:=MV);
{endregion}
{region 'Objects in some program'}
  PreHtr    : FB_BA_View    := (      iLabel:=MyLabels.PreHtr);
  TFl    : FB_BA_AI_Raw    := (iParent:=PreHtr,  iLabel:=MyLabels.TFl_MV);
  TRt    : FB_BA_AI_Raw    := (iParent:=PreHtr,  iLabel:=MyLabels.TRt_MV);
{endregion}