Mitsubishi Electric M800VW Series Programming Manual page 439

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 data designated by (S) is not a BCD value. (Error code: 34)
- The data designated by (S) is outside the range of -1.0000 to 1.0000. (Error code: 34)
- The range of the device designated by (S) exceeds the relevant device range. (Error code: 82)
 Program example
 The following program performs a SIN
integer part designated as BCD 1-digit from X30 to X33, and the decimal fraction part designated as BCD 4-digit from X20
to X2F, and stores the calculated angle as BCD 4-digits in D10.
X0
0
X0
3
SM400
6
12
= D1 K1
> D1 K1
M0
22
26
X0 OFF
X33 X30
BCD value
X2F
4
7
BCD value
IB-1501667-B
-1
operation on the sign (positive when X0 is OFF, and negative when X0 is ON), the
[Ladder mode]
MOV K1 D0
Sets the sign of a SIN
value (1)
MOV K0 D0
Sets the integer part of a
MOV K1X30 D1
SIN value (2)
Sets the decimal fraction
MOV K4X20 D2
part of a SIN value (3)
<> D2 K0
M0
Executes range check for
the set SIN value
BASIN D0 D10
Executes SIN-1 operation
and stores the result of
operation to D10 (4)
END
[Operations when X20 to X33 designate a value of 0.4753]
(1)
0
0
BCD value
(2) Transfer
0
0
0
MOV
BCD value
(3) Transfer
X20
5
3
4
7
MOV
BCD value
D0
0
0
D1
(4)
BASIN
operation
0
0
BASIN
D2
5
3
418
[List mode]
Steps
Inst.
Device
0
LD
X0
1
MOV
K1
D0
3
LDI
X0
4
MOV
K0
D0
6
LD
SM400
7
MOV
K1X30
D1
10
MOV
K4X20
D2
12
LD=
D1
K1
15
AND
<> D2
K0
18
OR>
D1
K1
21
OUT
M0
22
OR
M0
23
BASIN
D0
D10
26
END
D10
0
0
2
8
BCD value

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents