Mitsubishi Electric M800VW Series Programming Manual page 382

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 COS 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
COSD D10 D0
12
X2F
0
0
6
BCD value
D23
D22
D21
60
64-bit floating-point real
number
1024
1024
[Ladder mode]
Inputs an angle used for COS 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 COS operation using the
converted radian value (4).
END
[Operations when X20 to X2F designate a value of 60]
X20
b15
(1) Conversion to BIN
0
BIN
(2) Conversion to floating-point
real number
FLTD
(3) Conversion to
radian value
D13
D20
64-bit floating-point real
RADD
number
D30
b0
60
BIN value
(4) COS operation
D12
D11
D10
1.047198
COSD
361
[List mode]
Steps
Inst.
Device
0
LD
SM400
1
BIN
K4X20
D30
3
FLTD
D30
D20
6
RADD
D20
D10
9
COSD
D10
D0
12
END
D3
D2
D1
D0
0.500000
64-bit floating-point real
number
IB-1501667-B

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents