Mitsubishi MELSEC-Q/L Programming Manual page 554

Table of Contents

Advertisement

BATAN, BATANP
Program Example
(1) The following program performs a TAN
the BCD 4-digit integer part from X20 to X2F and the BCD 4-digit decimal fraction part from X30 to X3F, and outputs the
calculated angle in 4 BCD digits from Y40 to Y4F.
[Ladder Mode]
[List Mode]
Step
Instruction
[Operations involved when X0 and X20 to X2F designate a value of 1.2654]
1
X0 OFF
Transfer
2
X2F
X20
0
0
0
1
MOV
BCD value
3
Transfer
X3F
X30
2
6
5
4
MOV
BCD value
552
-1
operation on the sign (positive when X0 is OFF, and negative when X0 is ON),
Sets the sign of a TAN value (
Sets the integer part of a TAN value (
Sets the decimal fraction part of a TAN value (
Executes TAN -1 operation and outputs
the result of operation to Y40 to Y4F (
Device
D0
0
0
0
0
BCD value
D1
BATAN operation
4
Y4F
0
0
0
1
BCD value
BATAN
D2
2
6
5
4
BCD value
)
1
2
4
Y40
0
0
5
2
BCD value
)
)
3
)

Advertisement

Table of Contents
loading

Table of Contents