Mitsubishi Electric M800VW Series Programming Manual page 416

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 a negative number. (Error code: 34)
- 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
 Program example
 The following program seeks the square root of the value 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.
X0
0
9
64-bit floating-point real number
1024
1024
[Ladder mode]
Inputs data used for square
root operation (1)
BIN K4X20 D20
Converts the input data into
a 64-bit floating-point real
FLTD D20 D10
number (2)
SQRD D10 D0
Executes square root
operation (3)
END
[Operations when X20 to X2F designate a value of 650]
(1)Conversion to BIN
X2F
X20
0
6
5
0
BIN
BCD value
D13
D12
D11
D10
650
D20
b15
b0
650
BIN value
(2)Conversion to floating-point
real number
FLTD
(3)SQR
operation
D3
D2
D1
D0
25.4951
SQRD
64-bit floating-point real number
395
[List mode]
Steps
Inst.
Device
0
LD
X0
1
BIN
K4X20
D20
3
FLT
D20
D10
6
SQRD
D10
D0
9
END
IB-1501667-B

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents