349
D D A B N
I
P
D
S
FNC
260
1
2
M
3
○
X Y M S
D.b R.b
KnX KnY
KnM KnS
T C
D,R
V,Z
UnG
K,H
E
" $"
S
D
S : the head ID of the devices where the decimal
ASCII string is stored
D : the converted BIN number result
DABIN D0 D10
X0
S
When the X0 = “ON”, this 16-bit instruction converts the content of an ASCII code string at D0~D2, then stores the
result of a BIN number to the D10.
0
1
2
3
4
5
6
7
SPACE
–
8
9
30H 31H 32H 33H 34H 35H 36H 37H 20H
2DH
38H 39H
D
This instruction uses a decimal format ASCII string number started from the to perform the BIN number
conversion, then stores the result into the device .
S
D
00H
NULL
S
2DH( –) 31H(1) 32H(2) 35H(5)
Sign code
4
10
3
10
2
10
1
10
0
10
38H( 8) 39H(9)
–12589
D10
D
The lowest byte in the string is the sign code for the conversion. If the sign is 2DH, the number is negative;
otherwise, 20H means positive.
The remaining bytes are to store the data of a value. If the ASCII codes in this segment of value have the 20H, 00H
or 30H, that will be treated as 30H.
For a 16-bit instruction, the available range is –32,768~+32,767.
For a 32-bit instruction, the structure of the source string starting from the is shown below.
(assume the = D0)
S
S
S
9
10
8
10
7
10
6
10
5
10
4
10
3
10
2
10
1
10
0
10
Ignore
For a 32-bit instruction, the available range is –2,147,483,648~+2,147,483,647. Therefore, with a sign code, that
will occupy 11 bytes.
If the source string contains a code which is improper or the result is exceeded to the available range, the PLC
will regard that as an operational error.
S
For a 16-bit instruction, S occupies 3 components For a 32-bit instruction, S occupies 6 components
Operand
Devices
Convert Decimal ASCII String to
BIN Number
Sign & Number
ASCII Cord
This instruction will use the following ASCII conversion table:
D0
Lower
8 bits
D0
Upper
8 bits
D1
Lower
8 bits
D1
Upper
8 bits
D2
Lower
8 bits
D2
Upper
8 bits
D0
Lower
8 bits
D0
Upper
8 bits
D1
Lower
8 bits
D1
Upper
8 bits
D2
Lower
8 bits
D3
Lower
8 bits
D4
Lower
8 bits
D5
Lower
8 bits
D2
Upper
8 bits
D3
Upper
8 bits
D4
Upper
8 bits
D5
Upper
8 bits
Sign code