FB_RandomGenerator - Init (Method)

Overview

Type:

Method

Available as of:

V1.0.0.0

Versions:

Current version

Task

Initialization of the random generator FB_RandomGenerator

Description

As the generation of the random numbers is effected in accordance with the linear congruence method, a start value i_diNstart is required which is set by means of the Init method. This can be any integer > 0 which is located within the value range of data type DINT.

This method must have been called up once before calling up the GetDint or GetLreal methods.

Interface

Input

Data type

Description

i_diNStart

DINT

Start value of the random number row

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

Diagnostic Messages

q_etDiag

q_etDiagExt

Enumeration value

Description

OK

Ok

0

Ok

InputParameterInvalid

NStartRange

92

NStart is outside the valid range.

NStartRange

Enumeration name:

NStartRange

Enumeration value:

92

Description:

NStart is outside the valid range.

Issue

Cause

Solution

-

At the input i_diNStart, an invalid value has been transferred.

At the input i_diNStart, a value greater than 0 must be transferred.

Ok

Enumeration name:

Ok

Enumeration value:

0

Description:

Ok

The initialization has been completed successfully.