FB_RandomGenerator - Init (Method)

Overview

Type:

Method

Available as of:

V1.0.0.0

Versions:

Current version

Task

The method Init initializes the random generator FB_RandomGenerator.

Description

The random numbers are generated according to the linear congruence method. The required start value i_diNstart is set using 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 once before calling 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_etResult

ET_Result

Provides diagnostic and status information as an enumeration value.

q_sResultMsg

STRING [80]

Provides additional diagnostic and status information as a text message.

Return Value

Data type

Description

BOOL

TRUE= The execution of the method was successful.

FALSE = The execution of the method was unsuccessful.

Diagnostic Messages

The following elements of ET_Result are used for q_etResult.

Name

Data type

Value

Description

Ok

UDINT

0

Operation completed successfully.

NStartRange

UDINT

20

Value at input i_diNStart is less than or equal to 0.