540
BSQR, BSQRP, BDSQR, BDSQRP
F
unct
i
on
The random number generation instruction generates random numbers conforming to a certain calculation formula. In the
calculation using the formula, the result of previous calculation is used as a coefficient.
The random series change instruction can change the random number generation pattern.
RND
Generates random number of from 0 to 32767, and stores at device designated by .
SRND
Updates random number series according to the 16-bit BIN data being stored in device designated by .
Operat
i
on
E
rror
(1) There is no operation error in the RND(P) or SRND(P) instruction.
Program
E
xamp
l
e
(1) The following program stores random number at D100 when X10 is turned ON.
[Ladder Mode]
[List Mode]
(2) The following program updates a random number series according to the contents of D0 when X10 is turned ON.
[Ladder Mode]
[List Mode]
: Data of which the square root is obtained or the number of the device where the data is stored (BSQR(P): BCD 4 digits, BDSQR(P): BCD 8 digits)
: Head number of the devices where the square root calculation result will be stored (BCD 4 digits)
7.12.28 BSQR, BSQRP
BCD 4-digit square roots
BDSQR, BDSQRP
BCD 8-digit square roots
7.12.28
BSQR, BSQRP, BDSQR, BDSQRP
Setting
Data
Internal Devices
R, ZR
J \
U \G
Zn
Constants
K, H
Other
Bit
Word
Bit
Word
––
––
––
D
S
Step
I
nstruct
i
on
De
vi
ce
Step
I
nstruct
i
on
De
vi
ce
Process
High
performance
Redundant Universal
LCPU
Bas
i
c
Command
Command
P
S
D
S
D
BSQR,BDSQR
BSQRP,BDSQRP
BS
Q
R
/
BDS
Q
R
S
D
S
D