FB_Logger - General Information

Overview

Type:

Function block

Available as of:

V1.0.4.0

Inherits from:

-

Implemented:

-

Task

The POU saves output information or status changes to a data structure.

Description

The POU is enabled using the i_xEnable input. The q_xActive output shows that the logger POU is active. The q_xReady output shows whether the POU is ready for operation. The POU state can be read from the q_etDiag, q_etDiagExt and q_sMsg outputs.

During operation, changes are detected at the i_diCmd, i_diStartStep and i_stReaction inputs and saved to the iq_stLogDataList structure.

The time of day, the date of the PacDrive controller, the module name and ModuleId are included for every entry in the structure.

The log data list is a trace buffer in which the oldest entry is overwritten. The position where the next entry should be made is defined in the udiLogDataIndex contained in the list. If the iq_stLogDataList cannot be accessed, the event is first written into a local memory. If no more than 5 entries can be transferred to the global log data list, an exception message that is entered into the global exception list is generated.

The quantity of changes can be limited via the i_wLogDataFilter variable according to the following criteria. The filter options are summarized in the ET_LogDataFilter enumeration type.

The i_wLogDataFilter input or the word is evaluated bit by bit in the POU.

If all changes are to be recorded, all elements from ET_LogDataFilter must be OR-linked and the result must be assigned to the i_wLogDataFilter input. Alternatively, i_wLogDataFilter can also be initialized with 16#FF.

Interface

Input

Data type

Description

i_xEnable

BOOL

A rising edge FALSE -> TRUE activates the POU, a falling edge TRUE -> FALSE deactivates the POU.

A deactivated POU does not execute any actions.

i_wLogDataFilter

WORD

Defines which events are entered into the global log data list.

Can be assigned with values of the ET_LogDataFilter enumeration.

i_sModuleName

STRING[80]

Name of the module the events of which are logged.

i_udiModuleId

UDINT

ID of the module the events of which are logged.

i_diCmd

DINT

Command that was sent to the module.

i_diStartStep

DINT

Start step in the command table that was transferred to the module.

i_stReaction

ST_Reaction

Reactions that were sent to the module.

Output

Data type

Description

q_xActive

BOOL

TRUE: The POU is active and has to be executed further.

FALSE: The POU is inactive.

q_xReady

BOOL

TRUE: The POU is ready to operate and accepts user commands.

FALSE: the POU is not ready to operate and does not accept user commands.

q_etDiag

GD.ET_Diag

General, library-independent statement on the diagnostic.

A value unequal GD.ET_Diag.Ok equates an error message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = GD.ET_Diag.Ok -> Status message

q_etDiag <> GD.ET_Diag.Ok -> Error message

Input/Output

Data type

Description

iq_stExceptionList

ST_ExceptionList

Global exception list

iq_stLogDataList

ST_LogDataList

Global log data list

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Disabled

22

Diagnostic message disabled

OK

Initializing

37

Initialization

OK

WaitForEvent

23

Waiting for an event.

UnexpectedProgramBehavior

InitLogDataListFailed

48

Initialization of the log data list failed.

Disabled

Enumeration name:

Disabled

Enumeration value:

22

Description:

Diagnostic message disabled

The function block is deactivated, it executes no actions whatsoever. i_xEnable and q_xActive have the value FALSE.

Initializing

Enumeration name:

Initializing

Enumeration value:

37

Description:

Initialization

The function block is being initialized and thus is not yet ready to receive commands at its inputs. The function block will signalize that it is ready for operation with the signal q_xReady = TRUE.

InitLogDataListFailed

Enumeration name:

InitLogDataListFailed

Enumeration value:

48

Description:

Initialization of the log data list failed.

Issue

Cause

Solution

-

Initialization of the exception list failed. - An internal execution error has been detected.

Try to initialize the exception list using the FC_InitLogDataList function.

Please inform your Schneider Electric representative about this detected error.

WaitForEvent

Enumeration name:

WaitForEvent

Enumeration value:

23

Description:

Waiting for an event.

Waiting for an event to be entered into the log data list.