7-312
BCOS(P)
Program Example
(1) The following program calculates the cosine of the data designated by the 3 BCD digits from
X20 to X2B and outputs the integer part of the result to 1 BCD digit from Y50 to Y53, and the
decimal fraction part of the result to the 4 BCD digits from Y40 to Y4F.
Y60 is turned ON if the results of the operation are negative.
[Ladder Mode]
[List Mode]
[Operations involved when value designated by X20 to X2B is 430]
Processes so that the input
angle is within 360° ( )
Executes COS operation ( )
Outputs the integer part of the operation
result to a display device ( )
Outputs the decimal fraction part of the
operation result to a display device ( )
Outputs the sign of the operation result
by ON or OFF ( )
1
2
3
4
5
Step Instruction Device
X2B
BCD value
430
X20
B/ operation
B/
BCOS
operation
BCOS
OUT
D10
BCD value
(quotient)
0001
D11
BCD value
(remainder)
0070
D20
Transfer
MOV
D21
Transfer
MOV
D22
BCD value
0000
BCD value
0000
BCD value
3420
Y4F
BCD value
3420
Y40
Y53
BCD value
0
Y
50
Y60 ON
1
2
3
4
5