7-278
7.12 Special Function Instructions
7.12.23 Random number generation and series update
RND, SRND
RND(P)
Generates random numbers from 0 to 32767, and stores them to the device specified for
.
SRND(P)
Updates random number series according to the 16-bit BIN data stored in the device
specified for
.
O
peration Error
No operation error occurs in the execution of the RND(P) and SRND(P) instructions.
Program Example
(1) In the following program, the random number is stored to Var_D100 when X10 turns ON.
[Structured ladder]
[ST]
RND(X10,Var_D100);
(2) In the following program, the random number series is updated according to the value of
Var_D0 when X10 turns ON.
[Structured ladder]
[ST]
SRND(X10,Var_D0);
d
s
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......