7-185
BINDA(P),DBINDA(P)
1
2
3
4
6
6
7
8
7.11 Character string processing instructions
7.11.1 Conversion from BIN 16-bit or 32-bit to decimal ASCII (BINDA(P),DBINDA(P))
Operation Error
(1) In the following case, an operation error occurs, the error flag (SM0) turns ON, and an error
code is stored into SD0.
• The device specified by exceeds the range of the corresponding device.
(For the Universal model QCPU only.) (Error code: 4101)
Program Example
(1) The following example program uses the PR instruction to output the 16-bit BIN data W0
value by decimal to Y40 to Y48 as ASCII.
[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.
(2) The following program uses the PR instruction to output the decimal value of the 32-bit BIN
data at W10 and W11 in ASCII code to Y40 to Y48.
[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.
DD
Step Instruction Device
D1
D2
D3
20H(space)20H(space)
35H (5)31H (1)
b15 b8b7 b0
32H (2)36H (6)
00H
D0
5126
W0
BIN value
PR
is output.
Y40 to Y48
Step Instruction Device
D1
D2
D3
2DH ()20H(space)
20H(space)20H(space)
b15 b8b7 b0
33 H (3)38H (8)
D0 PR
Y40 to Y48
34H (4)32H (2)
35 H (5)36H (6)
33H
(3)00H
is output.
3842563
W11
BIN value
W10
D4
D5
- 3842563