Mitsubishi Electric M800VW Series Programming Manual page 443

Plc programming
Hide thumbs Also See for M800VW Series:
Table of Contents

Advertisement

M800V/M80V Series PLC Programming Manual (1/2)
8 Function Instructions
8.11 Special Function Instructions
 Operation errors
 In the following cases, an arithmetic error occurs, the error flag (SM0) turns ON, and an error code is stored at SD0.
- The data designated by (S) is not a BCD value. (Error code: 34)
- The range of the device designated by (S) exceeds the relevant device range. (Error code: 82)
 Program example
 The following program performs a TAN
integer part designated as BCD 4-digit from X20 to X2F, and the decimal fraction part designated as BCD 4-digit from X30
to X3F, and stores the calculated angle as BCD 4-digits in D10.
X0
0
X0
3
SM400
6
14
X0 OFF
X2F
0
0
BCD value
X3F
2
6
BCD value
IB-1501667-B
-1
operation on the sign (positive when X0 is OFF, and negative when X0 is ON), the
[Ladder mode]
MOV K1 D0
Sets the sign of a TAN
value (1)
MOV K0 D0
Sets the integer part of a
MOV K4X20 D1
TAN value (2)
Sets the decimal fraction
MOV K4X30 D2
part of a TAN value (3)
BATANP D0 D10
Executes TAN
and stores the result of
END
operation to D10 (4)
[Operations when X0 and X20 to X2F designate a value of 1.2654]
(1)
D0
0
0
BCD value
X20
(2) Transfer
D1
0
1
0
0
MOV
BCD value
X30
(3) Transfer
D2
5
4
2
6
MOV
BCD value
-1
operation
0
0
(4) BATAN operation
0
1
BATAN
5
4
422
[List mode]
Steps
Inst.
Device
0
LD
X0
1
MOV
K1
D0
3
LDI
X0
4
MOV
K0
D0
6
LD
SM400
7
MOV
K4X20
D1
9
MOV
K4X30
D2
11
BATANP
D0
D10
14
END
D10
0
0
5
2
BCD value

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents