FB_ExceptionHandler2 - SetException (Method)

Overview

Type:

Method

Available as of:

V1.4.0.0

Task

Method for entering and deleting exceptions in a (global) exception list (ST_ExceptionList).

Description

NOTE: The functionality of the method equates to the FC_SetException function. The method additionally triggers messages for the Application Logger via the logger point of the FB_ExceptionHandler2.

To add an exception via iq_stException (ST_Exception) to the exception list in iq_stExceptionList (ST_ExceptionList), call the method with i_xExceptionActive := TRUE.

To delete a delayed exception, where timDelayTime > 0, before becoming active or to acknowledge an active exception, where xAutoQuit := TRUE, call the method with i_xExceptionActive := FALSE and the relevant data in iq_stException (ST_Exception) and in iq_stExceptionList (ST_ExceptionList).

This information is also added to the logging list in iq_stLogDataList (ST_LogDataList).

NOTE: The following parameters in iq_stException (ST_Exception) must not be modified in your application. These values are written by the method:
  • todTimeStamp

  • todElapsedTime

  • todReactionTimeStamp

Interface

Input

Data type

Description

i_xExceptionActive

BOOL

TRUE: Add the exception to the specified exception list.

FALSE: Delete a delayed exception before becoming active or acknowledge an active exception where xAutoQuit := TRUE.

Output

Data type

Description

q_etDiag

GD.ET_Diag

General, library-independent statement on the diagnostic.

A value unequal GD.ET_Diag.Ok equates to an exception 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 -> exception message

q_sMsg

STRING[80]

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

Input/Output

Data type

Description

iq_stException

ST_Exception

Exception that shall be entered into the global exception list.

iq_stExceptionList

ST_ExceptionList

Global exception list

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

DelayStillActiveExceptionNotSet

93

The delay is still active. The exception has not been set yet.

OK

ExceptionRemovedByAutoQuit

91

The exception was removed with AutoQuit.

OK

ExceptionSuccessfullySet

92

The exception was set successfully.

OK

Ok

0

Ok

ControllerConditionInvalid

ControllerInvalid

6

The controller is invalid.

ControllerConditionInvalid

RealtimeClockNotSet

90

The real-time clock was not set.

LimitReached

ExceptionListOverflow

44

Overflow of the exception list

UnexpectedProgramBehavior

InitExceptionListFailed

46

Initialization of the exception list failed.

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, refer to the q_sMsg output.

DelayStillActiveExceptionNotSet

Enumeration name:

DelayStillActiveExceptionNotSet

Enumeration value:

93

Description:

The delay is still active. The exception has not been set yet.

The delay is still active, the exception has not yet been entered into the global exception list.

ExceptionListOverflow

Enumeration name:

ExceptionListOverflow

Enumeration value:

44

Description:

Overflow of the exception list

Issue

Cause

Solution

-

The maximum number of exceptions in the global exception list specified by the Gc_udiMaxNumberOfExceptions global parameter was exceeded.

Increase the value of the Gc_udiMaxNumberOfExceptions global parameter.

ExceptionRemovedByAutoQuit

Enumeration name:

ExceptionRemovedByAutoQuit

Enumeration value:

91

Description:

The exception was removed with AutoQuit.

The exception was removed by acknowledging it automatically.

ExceptionSuccessfullySet

Enumeration name:

ExceptionSuccessfullySet

Enumeration value:

92

Description:

The exception was set successfully.

The exception successfully has been entered into the global exception list.

InitExceptionListFailed

Enumeration name:

InitExceptionListFailed

Enumeration value:

46

Description:

Initialization of the exception list failed.

Issue

Cause

Solution

-

Initialization of the exception list failed. - An internal execution error occured.

Try to initialize the exception list using the FC_InitExceptionList function.

Please inform the support team about this error.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

Initialization value of the q_etDiagExt output.

Exception already entered to exception list.

RealtimeClockNotSet

Enumeration name:

RealtimeClockNotSet

Enumeration value:

90

Description:

The real-time clock was not set.

Issue

Cause

Solution

-

The real time clock of the controller has not been set.

Initialize the real time clock of the controller.