The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
S

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
3

Operands

OperandDescription
SThe only operand.
Entries are only WORD data registers.
This is the seed value for the random number generation.

The signed value range is -32,768 ~ 32,767 (216).
The unsigned value range is 0 ~ 65,535 (216-1).
The Hexadecimal value range is H0000 ~ HFFFF.

Notice

Error Flag (F11.0) Notice

The error flag, F11.0, will be ON for one scan when the address of the data register assigned by @D exceeds the range of the data register, D. The range of the data register, D, is dependent on the CPU type.

Execution Condition

It is recommend that the SRND instruction be used with a pulse contact as an execution condition, or use the SRNDP instruction.

Ladder Diagram Examples

SRND

The SRND instruction changes the seed value for random number generation to the WORD value of the data register S.

The SRND instruction changes the seed value for random number generation to the WORD value of the data register S.

When the contact, M0.2, is ON (1), the instruction uses the value, 732, as the seed for randomly generating the number, 3,191.

When the contact, M0.2, is ON (1), the instruction uses the value, 732, as the seed for randomly generating the number, 3,191.

SRNDP

The SRNDP one-shot instruction changes the seed value for random number generation to the WORD value of the data register S.

The SRNDP one-shot instruction changes the seed value for random number generation to the WORD value of the data register S. Every time this instruction executes, it energizes the output only once.

When the contact, M0.3, is ON (1), the instruction uses the value, 555, as the seed for randomly generating the number, 3,191.

When the contact, M0.3, is ON (1), the instruction uses the value, 555, as the seed for randomly generating the number, 3,191.