Mitsubishi Electric M800VW Series Programming Manual page 384

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 "-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 and D1 as a 32-bit floating-point real number.
SM400
0
BIN K4X20 D30
FLT D30 D20
RAD D20 D10
TAN D10 D0
13
X2F
0
1
3
BCD value
D21
135
32-bit floating-point real
number
128
[Ladder mode]
Inputs an angle used for TAN operation (1).
Converts the input angle into a 32-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]
X20
(1) Conversion to BIN
5
BIN
(2) Conversion to floating-point
real number
FLT
(3) Conversion to radian value
D11
D20
RAD
32-bit floating-point real
number
D30
b15
b0
135
BIN value
(4) TAN operation
D
1
0
2.356194
TAN
363
[List mode]
Steps
Inst.
Device
0
LD
SM400
1
BIN
K4X20
D30
4
FLT
D30
D20
7
RAD
D20
D10
10
TAN
D10
D0
13
END
D1
D
0
-1.000000
32-bit floating-point real
number
IB-1501667-B

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents