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:
- ObjectName
- Description
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.
![]() | 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:
- Simple labels (FB_BA_Label)
Provide the possibility to define texts for general use.
This means that simple labels can be reused in all objects, but also in further labels. - Dual labels (FB_BA_Label2x)
Provides the option of defining the equipment identifier of an object.
This means that both aggregate and function information can then be described.
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:
sObjectName : T_MaxString := '{}';
sDescription : T_MaxString := '{}';
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
- Substitute
A placeholder (here an index) is substituted for a value:sDescription := '{Idx}'
- Defining
A placeholder (here an index) is used to define a specific value:sDescription := '{Idx=10}'
Indexing
- Automatic indexing
Automatic indexing is set in the project template for objects in the last two levels of the project structure. This means that the ObjectName parameter also receives a consecutive index number in addition to a defined name. Indices (e.g. for aggregates) are automatically appended after the text.
While indices for the ObjectName parameter are normally always generated, Description indices appear depending on the current setting. - Manual indexing
Indexing can be specified using placeholders and their corresponding index attributes.
![]() | Manually defined indices (regardless of the purpose) are always displayed in the generated text. |
![]() | 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.
|
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:
- Parent settings
- Settings in the DPAD-FB used
- Manual overwriting using index attributes
- Global settings
- Placeholder with concatenation prohibition
Use cases
- Use case 1
A placeholder refers to a specific parameter.
Sample: Initialization of the ObjectNamesObjectName := '{}'
- Use case 2
A placeholder represents another parameter.
In this case, the placeholder must be addressed with its corresponding abbreviation.
Sample:sDescription := '{} - ID {InstID}'.
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 |
| Unsigned number |
Function Index |
| Unsigned number |
- Index attributes
Whether an index refers to an aggregate or a function depends on the order. - A stand-alone index refers to the function.
- Two indices refer to the aggregate (index 1) and the function (index 2)
Syntax
- Placeholder:
{}
- Placeholder that overwrites a parameter value (e.g.
sObjectName := '{MyValue}'
):{Value}
- Placeholder, as a representing attribute (e.g.
sDescription:= '{Idx}'
):{Attribute}
{Attribute1,Attribute(n),...} - Placeholder, as defining attribute (e.g.
sDescription:= '{Idx=10}'
):{Attribute=Value}
{Attribute1=Value,Attribute(n)=Value,...} - Placeholder, as a defining attribute which overwrites a parameter value (e.g.
sDescription:= '{Pump{Idx=10}}'
):{Value{Attribute=Value}}
- Placeholder with multiple attributes:
{Placeholder{Attribute1=Value,Attribute2=Value}}
- Placeholder, as a representing parameter (e.g.
sDescription:= '{} {InstID}'
):{Parameter}
- Placeholder that denies concatenation with parent elements. The entry point of the concatenation is defined. From this point on, only placeholders of the child elements are concatenated:
!{}
- Placeholder that denies certain attributes (switching off attributes):
{Value{!Attribute}}
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:
- Overwrite texts
If defined, a manually initialized title is used:fbSensor : FB_BA_AO_IO := (sObjectName:='Tmp03', sDescription:='Temperature sensor 3');
- 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); - 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}