7-288
7.12 Special Function Instructions
7.12.26 COS operation on data in BCD format
BCOS
[ST]
IF SM400 THEN
BINP(TRUE,K3X20,Var_D50);
BINP(TRUE,H360,Var_D51);
BCDP(TRUE,Var_D50 MOD Var_D51,Var_D11);
BCOS(TRUE,Var_D11,Var_D20);
MOV(TRUE,Var_D20[1],K1Y50);
MOV(TRUE,Var_D20[2],K4Y40);
END_IF;
OUT(Var_D20[0]<>0,Y60);
[Operation example when the value 430 is specified for X20 to X2B]
X
2
B
B
C
D value
4
3 0
X
20
B/operation
B/
B
COS
operation
B
COS
O
UT
Var_D
10
[
0
]
Var_D
10
[
1
]
B
C
D value
(
quotient
)
0 0 0 1
B
C
D value
(
remain
d
er
)
0 0 7 0
Var_D
20
[
0
]
Var_D
20
[
1
]
Var_D
20
[
2
]
Transfer
MO
V
Transfer
MO
V
B
C
D value
0 0 0 0
B
C
D value
0 0 0 0
B
C
D value
3
4
2 0
Y4F
B
C
D value
3
4
2 0
Y4
0
Y
53
B
C
D value
0
Y
50
Y
60
O
N
1
2
3
4
5
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: ......