Mitsubishi MELSEC-Q/L Programming Manual page 456

Table of Contents

Advertisement

BCDDA, BCDDAP, DBCDDA, DBCDDAP
Program Example
(1) 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 00
b15
W0
D0
1
2 9 5
D1
BCD value
D2
(2) 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 00
W11
W10
3
5 4 7 8 3 5 2
BCD value
454
[List Mode]
Step
b8b7
32
(2)
31
(1)
H
H
35
(5)
39
(9)
H
H
00
H
[List Mode]
Step
b15
b8b7
D0
35
(5)
33
H
D1
37
(7)
34
H
D2
33
(3)
38
H
D3
32
(2)
35
H
D4
00
H
Instruction
Device
is encountered.
H
b0
PR
Y40 to Y48
Outputs "1295"
Instruction
Device
is encountered.
H
b0
(3)
H
(4)
PR
H
Y40 to Y48
(8)
H
Outputs "35478352"
(5)
H

Advertisement

Table of Contents
loading

Table of Contents