Mitsubishi Electric M800VW Series Programming Manual page 388

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 value designated by (S) is outside the range of -1.0 to 1.0. (Error code: 34)
- 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 SIN
D30 as BCD 4-digit.
SM400
ASIN D0 D10
0
DEG D10 D20
INT D20 D30
10
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
-1
SIN
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 0.5]
(1)
D1
D0
operation
0.5
32-bit floating-point real
number
(3 )Conver-
D21
D20
sion to BIN
30
32-bit floating-point real
number
-1
SIN
D11
D10
0.5235988
32-bit floating-point real
ASIN
number
(2) Conversion to angle
DEG
D30
b15
b0
30
INT
BIN value
367
[List mode]
Steps
Inst.
Device
0
LD
SM400
1
ASIN
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