FB_BA_DecorMessage

FB_BA_DecorMessage 1:

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

FB_BA_DecorMessage 2: Outputs

Name

Type

Description

sText

T_MaxString

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)”

FB_BA_DecorMessage 3: Methods

Name

Definition location

Description

FormatTextN

Local

Formats and sets the message text using 1–5 arguments (FormatText1–5).

Finish

Local

Combines the message text with the decorations and completes the formatting.

Reset

Local

Resets the message text and all decorations (overrides the base method).

AddDecor

FB_BA_DecorString

Adds a formatted string with or without arguments.

FB_BA_DecorMessage 4: Properties

Name

Type

Access

Definition location

Description

Text

T_MaxString

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).