Random Number Instructions; Generating Random Number - Mitsubishi Electric MELSEC iQ-R Series Programming Manual

Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

7.10

Random Number Instructions

Generating random number

RND(P)
RnPCPU
RnPCPU
RnCPU RnENCPU
(Process)
(Redundant)
These instructions generate a random number between 0 and less than 32767, and store the random number in the specified
device.
Ladder
(d)
FBD/LD
EN
ENO
d
■Execution condition
Instruction
RND
RNDP
Setting data
■Description, range, data type
Operand
Description
(d)
Device for storing the random number
EN
Execution condition
ENO
Execution result
■Applicable devices
Operand
Bit
X, Y, M, L,
J\
SM, F, B, SB,
FX, FY
(d)
Processing details
These instructions generate a random number between 0 and 32767, and store the random number in the device specified by
(d). The RND(P) instruction generates random numbers according to a certain calculation expression. The calculation
expression uses the previous calculation result as a coefficient.
Operation error
There is no operation error.
RnSFCPU RnSFCPU
(Standard)
(Safety)
Execution condition
Word
T, ST, C, D, W,
U\G, J\,
SD, SW, FD, R,
U3E\(H)G
ZR, RD
ST
ENO:=RND(EN,d);
ENO:=RNDP(EN,d);
Range
Data type
16-bit signed binary
Bit
Bit
Double word Indirect
Z
LT, LST,
LZ
LC
7 APPLICATION INSTRUCTIONS
7.10 Random Number Instructions
Data type (label)
ANY16
BOOL
BOOL
Constant
Others
specification
K, H E
$
7
847

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents