Mitsubishi Electric M800VW Series Programming Manual page 386

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 designated device value is not within the following range. (Error code: 35)
-1022
0, 2
≤ | Designated device value | < 2
- The designated device value is "-0", unnormalized number, nonnumeric, or ± ∞ . (Error code: 35)
- The operation result exceeds the following range. (When an overflow occurs) (Error code: 36)
| Operation result | < 2
- An error occurred during operation. (Error code: 36)
 Program example
 The following program conducts a TAN operation on the angle set as BCD 4-digit from X20 to X2F and stores the result at
D0 to D3 as a 64-bit floating-point real number.
SM400
BIN K4X20 D30
0
FLTD D30 D20
RADD D20 D10
TAND D10 D0
12
X2F
0
1
3
BCD value
D23
D22
135
64-bit floating-point real
number
1024
1024
[Ladder mode]
Inputs an angle used for TAN operation (1).
Converts the input angle into a 64-bit
floating-point real number (2).
Converts the converted angle into a
radian value (3).
Executes TAN operation using the
converted radian value (4).
END
[Operations when X20 to X2F designate a value of 135]
(1) Conversion to BIN
X20
5
BIN
(2) Conversion to floating-point
real number
FLTD
(3) Conversion to radian value
D13
D21
D20
64-bit floating-point real
RADD
number
D30
b15
b0
135
BIN value
(4) TAN operation
D12
D11
D10
2.356194
TAND
365
[List mode]
Steps
Inst.
Device
0
LD
SM400
1
BIN
K4X20
D30
3
FLTD
D30
D20
6
RADD
D20
D10
9
TAND
D10
D0
12
END
D3
D2
D1
D0
-1.000000
64-bit floating-point real
number
IB-1501667-B

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents