FB_BA_LogMessage

FB_BA_LogMessage 1:

The function block FBBALogMessage is the concrete implementation of FB_BA_LogMessageItf and extends it with the interface I_SymbolPathPtr. This function block enables structured and reliable logging in the TwinCAT runtime with full support for Assertions and Show messages.

The function block stores the symbol path internally and automatically makes it available when messages are output via the ADS logging system. This allows for the unambiguous identification of the message source.

FB_BA_LogMessage 2:

The function block automatically detects repeated identical log codes and suppresses their output to prevent the log file from becoming overloaded. This suppression can be manually lifted using the Reset() method.

FB_BA_LogMessage 3:

The symbol path is automatically initialized in the FB_init() method. This removes the namespace prefix to make the log output easier to read.

Inherits from: FB_BA_LogMessageItf

Implemented: I_SymbolPathPtr

Syntax

FUNCTION_BLOCK FB_BA_LogMessage EXTENDS FB_BA_LogMessageItf IMPLEMENTS I_SymbolPathPtr

FB_BA_LogMessage 4: Methods

Name

Definition location

Description

Assert

FB_BA_LogMessageItf

Validates a condition and outputs an ERROR message (variants: Assert through Assert5).

Show

FB_BA_LogMessageItf

Outputs a message via the ADS logging system (variants: Show through Show5).

Reset

FB_BA_LogMessageItf

Resets the blocking logic so that the next message is output.

FB_BA_LogMessage 5: Properties

Name

Type

Access

Definition location

Description

SymbolPathPtr

POINTER TO T_MaxString

Get

Local

Returns a pointer to the internally stored symbol path.