FC_GenerateExceptionNumber

 

FC_GenerateExceptionNumber - General Information

Overview

Type:

Function

Available as of:

V1.4.0.0

Inherits from:

-

Implements:

-

Task

The Function generates the udiExceptionNumber for a ST_Exception structure.

Description

The udiExceptionNumber of a ST_Exception structure has to be a unique number to identify the exception which is used on e.g. a HMI to translate the exception into local language. The structure of udiExceptionNumber is defined as XXXYYYY where YYYY is the value of ET_DiagExt which describes the exception, and XXX is the value of ET_ExceptionSource which specifies the ET_DiagExt table where the ET_DiagExt comes from.

The input i_udiDiagExt is devided modulo by 10000. If values are given to the input greater than 9999, the result is not a unique number anymore, because there can be another ET_DiagExt with a value below 10000 which leads to the same number.

Interface

Input

Data type

Description

i_etSource

ET_ExceptionSource

The source describes the ET_DiagExt table where the input i_udiDiagExt is from.

i_udiDiagExt

UDINT

The value of ET_DiagExt.

Output

Data type

Description

q_etDiag

GD.ET_Diag

General, library-independent statement on the diagnostic.

A value unequal to GD.ET_Diag.Ok corresponds to a diagnostic 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 -> diagnostic message

Return Value

Data type

Description

UDINT

The number which combines ET_ExceptionSource and ET_DiagExt accoring to the rules of udiExceptionNumber in ST_Exception.

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The exception number was generated successfully.