Mitsubishi MELSEC Q Series Programming Manual page 683

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

Advertisement

Program Example
(1) The program example below calculates the SIN of 3-digit BCD data designated by X20 to
X2B, and outputs a 1-digit BCD part to the integer part from Y50 to Y53, and a 4-digit BCD
fraction part from Y40 to Y4F.
Y60 is turned ON if the results of the operation are negative. (If a value has been set at X20
to X2F that is greater than 360, it will be adjusted to be in the range from 0 to 360.)
[Ladder Mode]
[List Mode]
Step
Instruction
[Operations involved when value designated by X20 to X2B is 590]
X2B
X20
1
B/ operation
5 9 0
BCD value
B/
Processes so that the input
angle is within 360° (
Executes SIN 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)
BSIN
2
D11
operation
0 2 3 0
0 0 0 1
BCD value
BSIN
BCD value
(remainder)
0 0 0 0
BCD value
7 6 6 0
BCD value
)
1
)
2
)
3
4
)
5
5
D20
Y60 ON
OUT
D21
Transfer
3
Y53
Y50
0
MOV
BCD value
D22
Transfer
Y4F
4
7 6 6 0
MOV
BCD value
BSIN(P)
1
2
3
4
6
)
6
7
8
Y40
7-309

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec l series

Table of Contents