Mitsubishi MELSEC Q Series Programming Manual page 685

Common instruction 1/2
Hide thumbs Also See for MELSEC Q Series:
Table of Contents

Advertisement

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]
Step
Instruction
[Operations involved when value designated by X20 to X2B is 430]
X20 B/ operation
1
X2B
4 3 0
BCD value
B/
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 (
Device
D10
0 0 0 1
BCD value
(quotient)
BCOS
2
D11
D20
operation
0 0 7 0
0 0 0 0
BCD value
BCD value
BCOS
(remainder)
D21
0 0 0 0
BCD value
D22
3 4 2 0
BCD value
BCOS(P)
)
1
)
2
)
3
)
4
)
5
5
Y60 ON
OUT
Transfer
3
Y53
Y50
0
MOV
BCD value
Transfer
4
Y4F
Y40
3 4 2 0
MOV
BCD value
1
2
3
4
6
6
7
8
7-311

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents