EasyManua.ls Logo

Mitsubishi Electric MELSEC-Q/L - Page 538

Mitsubishi Electric MELSEC-Q/L
1084 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
536
7 APPLICATION INSTRUCTIONS
7.11 Character String Processing Instructions
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.
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] [List 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.
[Ladder Mode] [List 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.
Step Instruction Device
D1
D2
31
H
(1)32
H
(2)
39
H
(9)35
H
(5)
b15 b8b7 b0
00
H
D0
W0
BCD value
PR
Y40 to Y48
1
Outputs "1295"
29
5
Step Instruction Device
D1
D2
D3
33
H
(3)
35
H
(5)
34
H
(4)37
H
(7)
b15 b8b7 b0
38
H
(8)33
H
(3)
D0
35
H
(5)32
H
(2)
00
H
D4
3
W11
W10
PR
Y40 to Y48
Outputs "35478352"
5
4
7
83
5
2
BCD value

Table of Contents

Related product manuals