322
1
2
M
3
○
FNC
200
D PS T R
S1
S2
D
X Y M S
D.b R.b
KnX KnY
KnM KnS
T C
D,R
V,Z
UnG
K,H
E
" $"
S1
D
S2
S1 : the devices to appoint the conversion format
S2 : the source of a BIN number
D : the head ID of the devices where conversed character
string is stored
STR D10 D20 D0
X0
S1
S2
D
This instruction uses the format parameters at the to interpret a BIN number at the . By the format to
convert each digit of that number become an ASCII code and combine those codes to a string, then stores into the
devices which are headed by .
S1
S2
D
This instruction will use the following ASCII conversion table:
0
1
2
3
4
5
6
7 8
9
30H 31H 32H 33H 34H 35H 36H 37H 38H 39H
Assume the D10=8, D11=2, D20=-12345 and X0="ON", the instruction will be executed as follows:
D4
2DH( –)
20H( )
31H( 1) 2EH(•)32H( 2) 33H(3) 34H(4) 35H(5)
0000H
D
–12345
–
1
2
3
4
5
The expanded number during the conversion
SPACE
20H
2DH 2EH
–
D10
D11
8
2
Length of the
converted string
S1
+1
S1
Length of the converted string
Number of digits after the
decimal point at the string
16-bit instruction, the length = 2~8; 32-bit instruction, the length = 2~13.
16-bit instruction, the digits = 0~5; 32-bit instruction, the digits = 0~10.
S1
S2
D20
Number of digits after
the decimal point
Assume the content value of the 16-bit instruction's D10=7, D11=0 and D20=12345, the instruction will be
executed as follows:
12345
D10
D11
7
0
S1
S2
D20
1
2
3
4
5
Since the D11=0, that indicates an integer will be shown, so there is no decimal point in the string.
Operand
Devices
BIN to Character String Conversion
Sign & Number
ASCII Cord
D0
Lower
8 bits
D0
Upper
8 bits
D1
Lower
8 bits
D1
Upper
8 bits
D2
Lower
8 bits
D2
Upper
8 bits
Positive or
negative
sign
Space
Decimal
point
End of
string
Integer part
2 digits after the
decimal point
D3
Lower
8 bits
D3
Upper
8 bits
The positive or negative sign is using the 20H to represent positive; the 2DH represents negative.
The byte next to the positive or negative sign is a blank space, that will ll in the code 20H.
When the expanded number converts to the ASCII codes, the instruction adds the end of string at the tail
automatically. If the set length of the string is an odd number, the end of string is 00H; in addition, the string
with even number set length will add the end of string 0000H. Thus, the D4 at the converted string with the
value 0000H that is the end of string.
Length of the
converted string
Number of digits after
the decimal point