7-160
7.11 String Processing Instructions
7.11.2 16-/32-bit BIN data to hexadecimal ASCII data conversion
BINHA, DBINHA
(2) In the following program, the 32-bit BIN data in Var_W10 are converted to the hexadecimal
ASCII code data, and the results are output to Y40 to Y48 by the PR instruction. (Global
label Var_D0 is assigned to device D0.)
[Structured ladder]
[ST]
IF SM400 THEN
RST(TRUE,SM701);
DBINHAP(TRUE,Var_W10,Var_D0);
END_IF;
PR(X0,D0,Y40);
[Operation]
The ASCII code data are output to Y40 to Y48 by the execution of the PR instruction when
X0 turns ON.
Since SM701 is OFF, the PR instruction outputs ASCII code data up to 00
H
.
D
1
D
2
D
3
37
H
(7)
42
H
(
B
)
33
H
(3)
43
H
(C)
b15
b8b7
b0
35
H
(5)
38
H
(8)
D
0
31
H
(1)
46
H
(F)
00
H
D
4
7
B
3 C 5 8 1 F
H
Var
_W10
P
R
Y40
to
Y48
"7
B
3C581F"
i
s
output
Summary of Contents for MELSEC Q Series
Page 1: ...Structured Programming Manual Mitsubishi Programmable Controller QCPU Common Instructions ...
Page 2: ......
Page 14: ...A 12 MEMO ...
Page 340: ...6 178 MEMO MTR ...
Page 708: ...7 368 MEMO ...
Page 776: ...8 68 MEMO ...
Page 796: ...9 20 MEMO ...
Page 804: ...App 8 MEMO ...
Page 812: ...Index 8 MEMO ...
Page 815: ......