Mitsubishi MELSEC-Q/L Programming Manual page 542

Table of Contents

Advertisement

BSQR, BSQRP, BDSQR, BDSQRP
Function
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
Operation Error
(1) There is no operation error in the RND(P) or SRND(P) instruction.
Program Example
(1) The following program stores random number at D100 when X10 is turned ON.
[Ladder Mode]
(2) The following program updates a random number series according to the contents of D0 when X10 is turned ON.
[Ladder Mode]
7.12.28 BSQR, BSQRP
BCD 4-digit square roots
BDSQR, BDSQRP
BCD 8-digit square roots
7.12.28
BSQR, BSQRP, BDSQR, BDSQRP
BSQR,BDSQR
BSQRP,BDSQRP
: 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)
S
: Head number of the devices where the square root calculation result will be stored (BCD 4 digits)
D
Setting
Internal Devices
Data
Bit
Word
S
D
540
[List Mode]
Step
[List Mode]
Step
Command
Command
J
\
R, ZR
Bit
Word
.
D
Instruction
Device
Instruction
Device
High
Basic
Process
performance
S
P
S
Zn
U
\G
.
S
LCPU
Redundant Universal
BSQR/BDSQR
D
D
Constants
Other
K, H
––
––
––

Advertisement

Table of Contents
loading

Table of Contents