Chapter 6 Applied Instructions 
6-459 
API    Instruction code  Operand 
Function 
2107  D  $STR  P 
S
1
, S
2
, D 
Converting the binary number into 
the string 
Device
X  Y  M  S  T  C  HC  D  L  SM  SR  E  PR  K  16#  “$”  DF 
16-bit instruction (7 steps) 
32-bit instruction (7 steps) 
Symbol: 
S
1
:
Initial device in which the 
number of characters is stored 
Word/Double word
S
2
:
Value which is converted  Word/Double word
D
:
Initial device in which the 
conversion result is stored 
Word 
Explanation: 
1.  A decimal point is added to the value in S
2
, the value in S
1
+1 indicates the number of decimal 
places, and the value in S
1
 indicates the number of characters. The conversion result is stored 
in D. 
2.  $STR: 
The value in S
1
 should be within the range between 2 and 8. 
The value in S
1
+1 should be within the range between 0 and 5, and should be less than or 
equal to the value in S
1
 minus 3. 
The value in S
2
 should be within the range between -32768 and 32767. 
 
 b15
 b0
 b7
 b8
 16#00 ( )Ending character
Number of characters
 S1+1
Number of decimal places
Binary number
 .
 
 
Sign
 D+1
 D+2
 D+3
 D+4
Automatically stored at the end of the string
 S1
 S2
 D
Sign 
First ASCII code
Second ASCII code
Third ASCII code
Fourth ASCII code
Fifth ASCII code
Sixth ASCII code
Seventh ASCII code
 
Suppose the number of characters is 5, the number of decimal places is 1, and the value is 
-123. The conversion result is as follows.