Mitsubishi Electric M800VW Series Programming Manual page 431

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
 Program example
 The following program calculates the square root of the BCD value 1325, and stores the integer part at (D1) and the deci-
mal fraction part at (D2).
SM400
0
6
(1)
1325H
MOV
 The following program calculates the square root of the BCD value 74625813, and stores the integer part at (D2) and the
decimal fraction part at (D3).
SM400
0
7
(1)
74625813
BCD value
DMOV
IB-1501667-B
[Ladder mode]
Sets the data used for
MOV H1325 D0
square root operation (1)
BSQR D0 D1
Executes square root
operation (2)
END
[Operation]
(2)
BSQR
operation
D0
1
3
2
5
BCD value
BSQR
[Ladder mode]
Sets the data (BCD value)
used for square root
DMOV H74625813 D0
operation (1)
Executes square root
BDSQR D0 D2
operation (2)
END
[Operation]
D1
D0
7
4
6
2
5
8
1
BCD value
410
Steps
0
1
3
6
D1
Integer part
0
0
3
6
BCD value
D2
Decimal fraction part
4
0
0
5
BCD value
Steps
0
1
4
7
(2)
BDSQR
operation
D2
8
6
3
3
BCD value
D3
6
2
3
BDSQR
BCD value
[List mode]
Inst.
Device
LD
SM400
MOV
H1325
D0
BSQR
D0
D1
END
[List mode]
Inst.
Device
LD
SM400
MOV
H74625813
D0
BDSQR
D0
D2
END
8
Integer part
Decimal fraction part
3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents