The leader in industrial automation and control solutions

Instruction Parameters

Supported PLC Series

PLC-AESPLC-FBPLC-ES

Supported Data Registers

MXYKLFTCSZRQD@DConstant
D

Supported Flags

FlagBitSupport
ErrorF11.0
ZeroF11.1
CarryF11.2

Number of Steps

Steps
3

Operands

OperandDescription
DThe only operand.
Entries are only WORD data registers.
This is where the random number is stored.

The value range of the generated number is 0 ~ 32,767 (215-1).

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.

Instruction Behavior

The RND and RNDP instructions behave as follows:

  • The number randomly generated will be in the range of 0 ~ 32,767 (215-1).
    • The generation of a random number is based on an internal calculation formula.

Ladder Diagram Examples

RND

The RND instruction randomly generates a WORD value number and saves the number in an assigned WORD register, D.

The RND instruction randomly generates a WORD value number and saves the number in an assigned WORD register, D.

When the contact, M0.0, is ON (1), the instruction randomly generates the number, 7,103.

When the contact, M0.0, is ON (1), the instruction randomly generates the number, 7,103.

Memory Monitor

Memory Monitor for MapleLogic RND/RNDP instruction.

RNDP

The RNDP one-shot instruction randomly generates a WORD value number and saves the number in an assigned WORD register, D.

The RNDP one-shot instruction randomly generates a WORD value number and saves the number in an assigned WORD register, D. Every time this instruction executes, it energizes the output only once.

When the contact, M0.1, is ON (1), the instruction randomly generates the number, 27,850.

When the contact, M0.1, is ON (1), the instruction randomly generates the number, 27,850.

Memory Monitor

Memory Monitor for MapleLogic RND/RNDP instruction.