This function is used to define an exception. The function also activates the global exception list and the global logging list when the exception occurs. The global exception list is specified with the iq_stExceptionList input and it holds the active exceptions. The global logging list is specified via the iq_stLogDataList input and contains the last 100 exceptions (default). This default can be modified by changing the value of TPL.Gc_udiMaxNumberOfExceptions.A new exception replaces the oldest exception as soon as the logging list is full. The logging list can also contain other events.
The exception becomes active as soon as the input i_xSetException is set to TRUE:
The exceptions added to the global exception list
The exception is entered into the global logging list if the correct filter is on.
The reaction specified with the i_udiReaction input is then distributed to all axes with the FB_ExceptionHandlerTpi POU which continually scans the exception error detection list for new exceptions.
The reaction is placed into the global logging list if the correct filter is on.
An exception becomes inactive when the i_xSetException input is FALSE.
The exception is removed from the global exception list with the FB_ExceptionHandlerTpi POU.
The acknowledgement of the exception is entered into the global logging list if the correct filter is on.
The acknowledgement of the reaction is entered into the global logging list if the correct filter is on.
The i_sMsg input is used to provide a meaningful description for the detected error such as “Low Air Pressure, PS304”.
The i_etDiag input is used to assign each exception to a class. The i_udiDiagExt input is used to assign a unique diagnostic code to the exception.
The i_etExceptionSource input is used to indicate the source of the exception. Values of the ET_ExceptionSource enumeration can be used to assign a source as follows:
ET_ExceptionSource.Main (* Typical choice *)
ET_ExceptionSource.User (* Typical choice *)
The i_wHmiAttributes input can be used to further classify an exception.
The i_udiReaction input is used to assign the suitable reaction to an exception. A reaction specifies how an axis should stop. The ET_Reaction enumeration can be used to assign an error reaction as follows:
ET_Reaction.AsyncStop := 1,
ET_Reaction.SyncStopEl := 2,
ET_Reaction.SyncStopEh := 3,
ET_Reaction.StopEndOfCycle := 4,
ET_Reaction.MainsContactorOff := 5,
Input |
Data type |
Description |
---|---|---|
i_xSetException |
BOOL |
Specifies whether the exception is active or not. |
i_udiModuleId |
UDINT |
ModuleID of the module that reports the exception |
i_sModuleName |
STRING[80] |
Name of the module that reports the exception |
i_etDiag |
Diagnostic class of the exception |
|
i_udiDiagExt |
UDINT |
Specifies a number used to identify the exception. |
i_sDiagExt |
STRING[80] |
Name of the used udiDiagExt value |
i_wHmiAttributes |
WORD |
Used to categorize or identify exception occurred. |
i_sMsg |
STRING[Gc_udiMaxStringSizeOfExceptionMsg] |
Specifies a text description for the exception; typically used to indicate a message on an HMI. |
i_udiReaction |
UDINT |
Specifies how the axes should stop when this exception becomes active. |
i_etSource |
Specifies which software module type generates the exception; ET_ExceptionSource.Main is a typical value |
Output |
Data type |
Description |
---|---|---|
q_etDiag |
General, library-independent statement on the diagnostic. A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic message. |
|
q_etDiagExt |
POU-specific output on the diagnostic. q_etDiag = GD.ET_Diag.Ok -> status message q_etDiag <> GD.ET_Diag.Ok -> diagnostic 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 |
Specifies the global exception list. |
iq_stLogDataList |
ST_LogDataList |
Specifies the global logging list |
Data type |
Description |
---|---|
BOOL |
The function returns FALSE if the value of the reaction is greater than 32. |
q_etDiag |
q_etDiagExt |
Enumeration value |
Description |
---|---|---|---|
OK |
Ok |
0 |
Ok |
InputParameterInvalid |
ReactionRange |
73 |
The reaction is outside the specified range. |
Enumeration name: |
ReactionRange |
Enumeration value: |
73 |
Description: |
The reaction is outside the specified range. |
Issue |
Cause |
Solution |
---|---|---|
- |
Input parameter invalid. i_udiReaction is higher than the permitted value range. |
Set i_udiReaction less or equal Gc_udiMaxNumberOfReactions. Default value < 16. |