Mitsubishi Electric M800VW Series Programming Manual page 437

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 data designated by (S) is outside the range of 0 to 360. (Error code: 34)
- The data designated by (S) is 90 degrees or 270 degrees. (Error code: 34)
- The range of the device designated by (D) exceeds the relevant device range. (Error code: 82)
 Program example
 The following program calculates the TAN of the data designated as BCD 3-digit from X20 to X2B, and stores the integer
part as BCD 1-digit at (D21) and the decimal fraction part as BCD 4-digit at (D22).
SM400
0
5
= D11 K90
= D11 K270
M1
12
8
X2B
3
BCD value
IB-1501667-B
[Ladder mode]
Processes so that the input
B/ K3X20 K360 D10
angle is within 360° (1)
Uses M1 as an interlock so
M1
that operation will not be
executed if an input angle is
90° or 270°
BTAN D11 D20
Executes TAN operation (2)
END
[Operations when X20 to X2B designate a value of 390]
(1) B/operation
X20
9
0
0
BCD value (quotient)
B/
0
D10
0
0
1
(2) BTAN
D11
operation
0
3
0
BCD value
(remainder)
BTAN
416
[List mode]
Steps
Inst.
Device
0
LD
SM400
1
B/
K3X20
K360
D10
5
LD=
D11
K90
8
OR=
D11
K270
11
OUT
M1
12
OR
M1
13
BTAN
D11
D20
16
END
D20
0
0
0
0
BCD value
D21
0
0
0
0
BCD value
D22
5
7
7
4
BCD value

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents