Mitsubishi Electric M800VW Series Programming Manual page 396

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)
-126
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
 Program example
 The following program seeks the TAN
D30 as BCD 4-digit.
SM400
0
ATAN D0 D10
DEG D10 D20
INT D20 D30
10
32-bit floating-point real
number
32-bit floating-point real
number
128
128
-1
value of the 32-bit floating-point real number at D0 to D1, and stores the angle at
[Ladder mode]
Calculates an angle (radian value) by TAN
operation (1)
Converts the radian value into an angle (2)
Converts the angle in 32-bit floating-point
real number into an integer (3)
END
[Operations when the D0 and D1 value is 1]
(1) TAN
D1
D0
operation
1
(3) Conversion
D21
D20
to BIN
45
-1
-1
D11
D10
0.785398
32-bit floating-point real number
ATAN
(2) Conversion to angle
DEG
D30
b15
b0
45
INT
BIN value
375
[List mode]
Steps
Inst.
Device
0
LD
SM400
1
ATAN
D0
D10
4
DEG
D10
D20
7
INT
D20
D30
10
END
IB-1501667-B

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents