FB_LogDataControl - General Information

Overview

Type:

Function block

Available as of:

V1.0.4.0

Inherits from:

-

Implemented:

-

Task

Sorting, saving and deleting recorded data.

Description

The POU is enabled by using the i_xEnable input. The q_xActive output indicates that the 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.

The POU should be called in a separate task that has a low priority since the task requires more time due to several functions within the POU. During initialization of the POU, the monitoring times of the tasks are queried and increased. If the POU is switched off again, the original monitoring times determined at initialization are reset.

Exceptions arising in the POU are detected by the q_etDiag <> GD.ET_Diag.Ok output. These exceptions are also entered into the iq_stExceptionList global exception list. All exceptions have the ET_Reaction.StopEndOfCycle reaction. These exceptions can be acknowledged via the i_xDiagQuit input.

The global log data list that the FB_Logger describes is transferred to the FB_LoggerDataControl POU with the iq_stLogDataList list. The log data list is a trace buffer in which the oldest entry is overwritten.

The iq_stLogDataListAscii list is a list of results that may differ depending on the requirements on the POU via the i_xSave, i_xSort, i_etSortKey, i_xSortAndSave and i_udiModuleId inputs.

All entries in the iq_stLogDataList and iq_stLogDataListAscii lists are deleted via the i_xDelete input.

The data from iq_stLogDataList are transferred to iq_stLogDataListAscii and saved via the i_xSave input. The storage location can be specified using the i_sFileName. The entry is checked to determine if it is a drive and in which format the data should be saved (.CSV or .XML). Monitoring to determine if a UPS is available can be switched off if required. The system message logger can also be saved at the same location. The i_xEnableSaveMsgLog input can be used to influence whether it is saved.

Various sorting functions can be used via the i_xSort and i_etSortKey inputs. These are explained in detail in the ET_LogDataSortKey enumeration.

Sorting is done in descending order. When sorting by ModuleId, you can search for a certain module ID via the i_udiModuleId input. All submodules are also listed.

The functions described above can all be executed at once via the i_xSortAndSave input.

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_xDelete

BOOL

TRUE: Deleting all entries in the iq_stLogDataList and iq_stLogDataListAscii lists.

i_xSave

BOOL

TRUE: Saving all entries of the iq_stLogDataList list to a file.

i_sFileName

STRING[30]

Log file name.

i_xUsvCheckOff

BOOL

TRUE: Saving all entries to a file, even if no UPS is available.

(Caution - FlashDisk could be destroyed)

i_xEnableSaveMsgLog

BOOL

TRUE: The system message logger is also saved to the same directory using i_xSave or i_xSortAndSave.

i_xSort

BOOL

TRUE: Sorting all entries in the iq_stLogDataList list. The result is entered into the iq_stLogDataListAscii list.

i_etSortKey

ET_LogDataSortKey

Criteria that is to be used for sorting.

i_xSortAndSave

BOOL

TRUE: Sorting the data and saving to a file.

i_udiModuleId

UDINT

Module ID on the basis of which sorting shall take place. All entries of the submodules are listed as well.

i_xDiagQuit

BOOL

A rising edge FALSE -> TRUE acknowledges a pending diagnostic message (output q_etDiag <> GD.ET_Diag.Ok)).

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

q_sMsg

STRING[80]

Event-triggered message which gives more detailed information on the diagnostic state.

Input/Output

Data type

Description

iq_stExceptionList

ST_ExceptionList

Global exception list.

iq_stLogDataList

ST_LogDataList

Global log data list.

iq_stLogDataListAscii

ST_LogDataListAscii

Log data list in ASCII format. Serves as result list of the sorting functionalities.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

DeletingLogData

25

Log data are being deleted.

OK

DeletingLogDataDone

26

The deletion of log data has been completed.

OK

Disabled

22

Diagnostic message disabled

OK

Initializing

37

Initialization

OK

SavingLogDataDone

29

Saving the log data to a file has been completed.

OK

SavingLogDataToFile

27

Log data are being saved to a file.

OK

SortingLogData

31

Log data are being sorted.

OK

SortingLogDataAndSavingDone

30

Sorting and saving of the log data has been completed.

OK

SortingLogDataAndSavingToFile

28

Log data are sorted and saved to a file.

OK

SortingLogDataDone

32

Sorting of the log data has been completed.

OK

WaitForInput

24

Waiting for an input.

ControllerConditionInvalid

ControllerInvalid

6

The controller is invalid.

ExecutionAborted

LoggerStoringException

125

Exception while saving the logger.

FileHandlingInvalid

CouldNotOpenFile

9

Unable to open the file.

FileHandlingInvalid

FileNameExtensionInvalid

12

The file extension is invalid.

FileHandlingInvalid

MessageLoggerNotSaved

4

The message logger could not be saved.

FileHandlingInvalid

SavingNotAllowed

126

Saving is not permitted.

UnexpectedProgramBehavior

InitLogDataListFailed

48

Initialization of the log data list failed.

UnexpectedProgramBehavior

UnexpectedFeedback

10

An unintended error has been detected during execution.

ControllerInvalid

Enumeration name:

ControllerInvalid

Enumeration value:

6

Description:

The controller is invalid.

Issue

Cause

Solution

-

The controller does not provide the required conditions.

For more details, see q_sMsg output.

CouldNotOpenFile

Enumeration name:

CouldNotOpenFile

Enumeration value:

9

Description:

Unable to open the file.

Issue

Cause

Solution

-

The file i_sFileName could not be opened.

Verify whether the file called i_sFileName is stored on the data carrier.

Verify data carrier for defects.

DeletingLogData

Enumeration name:

DeletingLogData

Enumeration value:

25

Description:

Log data are being deleted.

All entries in the iq_stLogDataList and iq_stLogDataListAscii lists are deleted. i_xDelete was set to TRUE.

DeletingLogDataDone

Enumeration name:

DeletingLogDataDone

Enumeration value:

26

Description:

The deletion of log data has been completed.

All entries in the iq_stLogDataList and iq_stLogDataListAscii lists have been deleted.

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.

FileNameExtensionInvalid

Enumeration name:

FileNameExtensionInvalid

Enumeration value:

12

Description:

The file extension is invalid.

Issue

Cause

Solution

-

The file extension of the file specified under i_sFileName is invalid.

Choose a valid file extension ('.CSV' or '.XML').

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.

LoggerStoringException

Enumeration name:

LoggerStoringException

Enumeration value:

125

Description:

Exception while saving the logger.

Issue

Cause

Solution

-

An exception occurred while saving the iq_stLogDataList.

Repeat the saving process.

MessageLoggerNotSaved

Enumeration name:

MessageLoggerNotSaved

Enumeration value:

4

Description:

The message logger could not be saved.

Issue

Cause

Solution

-

Saving the system message logger failed.

Repeat the saving process.

SavingLogDataDone

Enumeration name:

SavingLogDataDone

Enumeration value:

29

Description:

Saving the log data to a file has been completed.

All entries from the iq_stLogDataList were transferred to the iq_stLogDataListAscii and saved.

SavingLogDataToFile

Enumeration name:

SavingLogDataToFile

Enumeration value:

27

Description:

Log data are being saved to a file.

All entries from the iq_stLogDataList were transferred to the iq_stLogDataListAscii and saved. The i_xSave input was set to TRUE.

SavingNotAllowed

Enumeration name:

SavingNotAllowed

Enumeration value:

126

Description:

Saving is not permitted.

Issue

Cause

Solution

-

Saving the iq_stLogDataList list is not permitted. - There might be no UPS installed.

Set the i_xEnableSaveMsgLog input to TRUE in order to be able to save the data also without UPS.

(Caution - FlashDisk could be destroyed)

SortingLogData

Enumeration name:

SortingLogData

Enumeration value:

31

Description:

Log data are being sorted.

All entries from the iq_stLogDataList are sorted and transferred to the iq_stLogDataListAscii. The i_xSort input was set to TRUE.

SortingLogDataAndSavingDone

Enumeration name:

SortingLogDataAndSavingDone

Enumeration value:

30

Description:

Sorting and saving of the log data has been completed.

All entries from the iq_stLogDataList were sorted, transferred to the iq_stLogDataListAscii and saved.

SortingLogDataAndSavingToFile

Enumeration name:

SortingLogDataAndSavingToFile

Enumeration value:

28

Description:

Log data are sorted and saved to a file.

All entries from the iq_stLogDataList were sorted, transferred to the iq_stLogDataListAscii and saved. The i_xSortAndSave input was set to TRUE.

SortingLogDataDone

Enumeration name:

SortingLogDataDone

Enumeration value:

32

Description:

Sorting of the log data has been completed.

All entries form the iq_stLogDataList were sorted and transferred to the iq_stLogDataListAscii.

UnexpectedFeedback

Enumeration name:

UnexpectedFeedback

Enumeration value:

10

Description:

An unintended error has been detected during execution.

Issue

Cause

Solution

-

An internal execution error has been detected.

Please inform your Schneider Electric representative about this detected error.

WaitForInput

Enumeration name:

WaitForInput

Enumeration value:

24

Description:

Waiting for an input.

Waiting for an input.

Set one of the following inputs to TRUE:

  • i_xSort: Sorting all entries of the iq_stLogDataList list and transfer to the iq_stLogDataListAscii list.

  • i_xSave: Saving all entries of the iq_stLogDataList list to a file and transfer to the iq_stLogDataListAscii list.

  • i_xSortAndSave: Sorting all entries of the iq_stLogDataList list, transfer to the iq_stLogDataListAscii list and saving to a file.

  • i_xDelete: Deleting all entries in the iq_stLogDataList and iq_stLogDataListAscii lists.