Mitsubishi Electric MELSEC-Q/L Programming Manual page 547

Hide thumbs Also See for MELSEC-Q/L:
Table of Contents

Advertisement

Program example
• The following program converts the decimal ASCII data set from D20 to D22 to BCD 4-digit data, and outputs the results to
Y40 to Y4F.
[Ladder Mode]
[List Mode]
Step
Instruction
[Operation]
b15
b8 b7
D20
34
(4)
20
(space)
H
H
D21
34
(4)
H
494
• The following program converts the decimal ASCII data set at D20 to D23 into 8-digit BCD data, stores the result at D10
and D11, and also outputs it to from Y40 to Y5F.
[Ladder Mode]
[List Mode]
Step
Instruction
[Operation]
b15
b8 b7
D20
34
(4)
20
(space)
H
H
D21
37
(7)
39
H
D22
39
32
(9)
H
D23
39
(9)
34
H
4972949
Outputs the converted
BCD value to a display device.
Device
b0
Y4F
39
(9)
H
Regarded
as 0494
Outputs the converted
BCD value to a display device.
Device
b0
(9)
H
(2)
H
Regarded
(4)
H
as 04972949
Y40
0 4 9 4
BCD value
D11
D10
DMOV
0 4 9 7 2 9 4 9
BCD value
7.11 Character String Processing Instructions
Y5F
Y50 Y4F
Y40
0 4 9 7 2 9 4 9
BCD value
7 APPLICATION INSTRUCTIONS
7
545

Advertisement

Table of Contents
loading

Table of Contents