Mitsubishi Electric M800VW Series Programming Manual page 249

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.3 Data Conversion Instructions
 Program example
 The following program converts the 64-bit floating-point real number at D20 to D23 to BIN 16-bit data, and stores the result
at D0.
[Ladder mode]
SM400
0
4
Conversion
D23
D22
D21
D20
to integer
25915.6796
64-bit floating-point real number
Conversion
D23
D22
D21 D20
to integer
-33562.3211
64-bit floating-point real number
 The following program converts the 64-bit floating-point real number at D20 to D23 to BIN 32-bit data, and stores the result
at D0 and D1.
[Ladder mode]
SM400
0
4
D23
D22
D21
D20
-574968.321
64-bit floating-point real number
D23
D22
D21 D20
2147483649.22
64-bit floating-point real number
IB-1501667-B
INTDP D20 D0
END
[Operation]
D0
25916
BIN value
An arithmetic error occurs because the specified data is
less than -32768.
DINTDP D20 D0
END
[Operation]
Conversion
D0
to integer
-574968
BIN value
Conversion
An arithmetic error occurs because the specified data is
larger than 2147483647.
[List mode]
Steps
Inst.
Device
0
LD
SM400
1
INTDP
D20
D0
4
END
[List mode]
Steps
Inst.
Device
0
LD
SM400
1
DINTDP
D20
D0
4
END
228

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents