Mitsubishi Electric M800VW Series Programming Manual page 435

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 0 to 360. (Error code: 34)
- The range of the device designated by (D) exceeds the relevant device range. (Error code: 82)
 Program example
 The following program calculates the COS of the data designated as BCD 3-digit from X20 to X2B, and stores the integer
part as BCD 1-digit at (D21) and the decimal fraction part as BCD 4-digit at (D22). (If the value set from X20 to X2F is
greater than 360, the value will be adjusted to be within the range of 0 to 360)
SM400
0
8
X2B
4
BCD value
IB-1501667-B
[Ladder mode]
Processes so that the input
B/ K3X20 K360 D10
angle is within 360° (1)
Executes COS operation (2)
BCOS D11 D20
END
[Operations when X20 to X2B designate a value of 430]
(1) B/operation
X20
3
0
0
B/
0
D10
0
0
1
BCD value
(2)
BCOS
(quotient)
D11
operation
0
7
0
BCD value
(remainder)
BCOS
414
[List mode]
Steps
Inst.
Device
0
LD
SM400
1
B/
K3X20
K360
D10
5
BCOS
D11
D20
8
END
D20
0
0
0
0
BCD value
D21
0
0
0
0
BCD value
D22
3
4
2
0
BCD value

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents