FB_BA_DecorMessage

Function block for creating formatted, decorated messages with text. This function block extends FBBA_DecorString_ with additional functions for processing and formatting message text. It combines a base message text with several formatted parameters and enables the creation of complex message outputs.
Inherits from: FB_BA_DecorString
Syntax
FUNCTION_BLOCK FB_BA_DecorMessage EXTENDS FB_BA_DecorString
VAR_OUTPUT
sText : T_MaxString;
END_VAR
Outputs
Name | Type | Description |
|---|---|---|
sText | The formatted message text. |
Example of use
FormatText1('My message', F_STRING('info'));
AddDecor1('value1: %d/%d', F_UINT(25), F_UINT(100));
AddDecor1('value2: %s', F_STRING('my string'));
Finish();Result: “My message (value1: 25/100, value2: my string)”
Methods
Name | Definition location | Description |
|---|---|---|
Local | Formats and sets the message text using 1–5 arguments (FormatText1–5). | |
Local | Combines the message text with the decorations and completes the formatting. | |
Local | Resets the message text and all decorations (overrides the base method). | |
Adds a formatted string with or without arguments. |
Properties
Name | Type | Access | Definition location | Description |
|---|---|---|---|---|
Text | Get/Set | Local | Direct access to read and write the message text. | |
IsEmpty | BOOL | Get | Local | Indicates whether the message text and decorations are empty (overrides the base property). |