7.12 Special Function Instructions
7.12.24 Square root operation on 4-/8-digit BCD data
7-281
7
APPLI
C
A
T
IO
N
INSTRUCTIONS
BSQ
R, BDSQ
R
BSQR, BDSQR
Program Example
(1) In the following program, the square root function is evaluated on 1325 in BCD value, and
the integer part is output in BCD 4 digits to the devices from Y50 to Y5F, and the decimal
fraction is output in BCD 4 digits to the devices from Y40 to Y4F.
[Structured ladder]
[ST]
IF SM400 THEN
MOV(TRUE,H1325,Var_D0);
BSQR(TRUE,Var_D0,Var_D1);
MOV(TRUE,D1,K4Y50);
MOV(TRUE,D2,K4Y40);
END_IF;
[Operation]
S
ets
the
d
ata
on
w
h
i
ch
the
square
root
funct
i
on
i
s
eva
l
uate
d. ( )
O
utputs
the
i
nteger
part
of
the
operat
i
on
resu
l
t
to
the
di
sp
l
a
y. ( )
O
utputs
the
d
ec
i
ma
l
fract
i
on
of
the
operat
i
on
resu
l
t
to
the
di
sp
l
a
y. ( )
S
quare
root
operat
i
on
( )
1
2
3
4
B
SQR
operation
B
SQR
D
1
B
C
D value
0 0 3 6
D
2
B
C
D value
4
0 0 5
Var_D
0
B
C
D value
1 3 2 5
MO
V
1325
H
Y
5
F
B
C
D value
0 0 3 6
Y
50
Y4F
B
C
D value
4
0 0 5
Y4
0
Transfer
MO
V
Transfer
MO
V
Integer part
Decimal fraction
1
2
3
4
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: ......