Mitsubishi Electric MELSEC-Q/L Programming Manual page 538

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

Advertisement

Program example
• The following program uses the PR instruction to convert BCD 4-digit data (the value at W0) to decimal, and outputs it in
ASCII format to Y40 to Y48.
[Ladder Mode]
[Operation]
Conducts ASCII output of Y40 to Y48 by using the PR instruction when X0 goes ON.
Because SM701 is OFF, the PR instruction will output ASCII code until 00H is encountered.
W0
D0
1
2 9 5
D1
BCD value
D2
• The following program uses the PR instruction to convert BCD 8-digit data (the values at W10 and W11) to decimal, and
outputs it in ASCII format to Y40 to 48.
[Ladder Mode]
[Operation]
Conducts ASCII output of Y40 to Y48 by using the PR instruction when X0 goes ON.
Because SM701 is OFF, the PR instruction will output ASCII code until 00H is encountered.
W11
W10
3
5 4 7 8 3 5 2
BCD value
7 APPLICATION INSTRUCTIONS
536
7.11 Character String Processing Instructions
b15
b8b7
32
(2)
31
H
35
(5)
39
H
00
H
b15
b8b7
D0
35
(5)
H
D1
37
(7)
H
D2
33
(3)
H
D3
32
(2)
H
D4
00
H
[List Mode]
Step
b0
(1)
PR
H
(9)
H
Outputs "1295"
[List Mode]
Step
b0
33
(3)
H
34
(4)
PR
H
38
(8)
H
Outputs "35478352"
35
(5)
H
Instruction
Device
Y40 to Y48
Instruction
Device
Y40 to Y48

Advertisement

Table of Contents
loading

Table of Contents