EasyManua.ls Logo

Mitsubishi Electric MELSEC-Q/L - Page 655

Mitsubishi Electric MELSEC-Q/L
1084 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
7 APPLICATION INSTRUCTIONS
7.12 Special Function Instructions
653
7
Program example
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)
007 0
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
Y50
Y60 ON
1
2
3
4
5

Table of Contents

Related product manuals