This POU records the following interactions between a module (machine) and its sub-module (axis):
Which reactions were sent to the axes
Which commands were sent to the axes
Which start steps were sent to the axes
The events are saved in the global logging list specified with the iq_stLogDataList input. The list stores the last 100 events (default). This default can be modified by changing the value of TPL.Gc_udiMaxNumberOfLogData. The newest event overwrites the oldest event once the list is full. It is useful for debugging and/or displaying historical data on a HMI.
The reactions, commands, and start steps are monitored through the default module interface for the machine specified with the iq_stMachineItf input. The POU logs events when it detects changes in the signals. The specific event to log is controlled by setting up “filters”.
The ET_LogDataFilter enumeration type can be used to specify which events are to be logged as follows:
ET_LogDataFilter.None := 2#0000000000000000
Log nothing or indicates a blank entry in the list
ET_LogDataFilte.CmdDone := 2#0000000000000001
Log when a command appears (diCMD > 0)
ET_LogDataFilter.CmdGo := 2#0000000000000010
Log when a command appears (diCMD > 0)
ET_LogDataFilter.StartStepCome := 2#0000000000000100
Log when a start step appears (diStartStep > 0)
ET_LogDataFilter.StartStepGo := 2#0000000000001000
Log when a start step finishes (diStartStep = 0)
ET_LogDataFilter.ReactionCome := 2#0000000000010000
Log when a reaction occurs (stReaction.axReaction[X] = TRUE)
ET_LogDataFilter.ReactionGo := 2#0000000000100000
Log when a reaction ends (stReaction.axReaction[X] = FALSE)
ET_LogDataFilter.ExceptionQuit := 2#0000000001000000
Log when an exception or advisory becomes inactive
ET_LogDataFilter.ExceptionCome := 2#0000000010000000
Log when an exception or advisory becomes active
ET_LogDataFilter.ExceptionAutoQuit := 2#0000000100000000
Log when an exception or advisory automatically becomes inactive
ET_LogDataFilter.User := 2#0000001000000000
ET_LogDataFilter.ModuleDefault := 2#0000000000111111
ET_LogDataFilter.ExceptionListDefault := 2#0000000111000000
The filter is of type DWORD with each bit position defining a specific type of event. The filters above can be summarized to one filter using an OR operation or by using the FC_InitLogDataFilter POU which causes the logger to react on the corresponding events. The FC_InitMachineInterface function also activates/deactivates the logging of events as shown below:
The output q_xActive indicates that the logger is activated and working correctly. The internal status of the function block can be read at the output q_etDiag and the corresponding message at the q_etDiagExt output. All the exceptions that are triggered by the function block are recorded in the defined global exception list by the in-/output iq_stExceptionList.
This is a function block that will require an instance of it to be declared.
Output |
Data type |
Description |
---|---|---|
q_xActive |
BOOL |
The POU is switched on and still has to be called up |
q_xReady |
BOOL |
The POU is ready and processing normally |
q_etDiag |
Diagnostic class |
|
q_etDiagExt |
Detailed diagnostic code of the POU |
Input/Output |
Data type |
Description |
---|---|---|
iq_stMachineItf |
ST_StandardModuleInterface |
Specifies the default module interface for the machine |
iq_stExceptionList |
ST_ExceptionList |
Specifies the global error detection list |
iq_stLogDataList |
ST_LogDataList |
Specifies the global logging list |
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. |
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.
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.
Enumeration name: |
InitLogDataListFailed |
Enumeration value: |
48 |
Description: |
Initialization of the log data list failed. |
Issue |
Cause |
Solution |
---|---|---|
- |
Initialization of the exception list failed. An error has been detected and occurred in the internal execution. |
Try to initialize the exception list using the FC_InitLogDataList function. Please inform the support team about this detected error. |