FB_RandomGenerator - GetDint (Method)

Overview

Type:

Method

Available as of:

V1.0.0.0

Versions:

Current version

Task

Creation of a random number

Description

Generates a random number of the DINT type according to the linear congruential method. See FB_RandomGenerator

Interface

Input

Data type

Description

i_diXmin

DINT

Lowest possible value of the random number

i_diXmax

DINT

Highest possible value of the random number

Output

Data type

Description

q_etDiag

GD.ET_Diag

General library-independent statement on the diagnostic.

A value not equal to ET_Diag.Ok corresponds to an diagnostic message.

q_etDiagExt

ET_DiagExt

POU-specific output on the diagnostic.

q_etDiag = ET_Diag.Ok -> Status message

q_etDiag <> ET_Diag.Ok -> Diagnostic message

Return Value

Data type

Description

DINT

Generated random number

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

ExecutionAborted

InitMethodNotCalled

93

The Init method has not been called up.

InitMethodNotCalled

Enumeration name:

InitMethodNotCalled

Enumeration value:

93

Description:

The Init method has not been called up.

Issue

Cause

Solution

-

The Init method has not been called up yet.

Before calling up the GetDint method for the first time, the Init method must be called up.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The random value has been calculated successfully.