Instruction Parameters
Supported PLC Series
| PLC-AES | PLC-FB | PLC-ES |
|---|---|---|
| ✓ | ✓ | ✓ |
Supported Data Registers
| M | X | Y | K | L | F | T | C | S | Z | R | Q | D | @D | Constant | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| S | ✓ | – | ✓ | ✓ | ✓ | – | ✓ | ✓ | – | ✓ | – | ✓ | ✓ | ✓ | – |
Supported Flags
| Flag | Bit | Support |
|---|---|---|
| Error | F11.0 | ✓ |
| Zero | F11.1 | – |
| Carry | F11.2 | – |
Number of Steps
| Steps |
|---|
| 3 |
Operands
| Operand | Description |
|---|---|
| S | The 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.

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. 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.
