AH500 Programming Manual 6.21.2 Explanation of String Processing Instructions Symbol: S : Source value Word/Double word D : Device in which the conversion result is stored Word Explanation: 1. The signed decimal binary number in S is converted into the ASCII code, and the conversion result is stored in D . 2. The instruction supports SM690, which controls the ending character. 3. The value in S used in the 16-bit instruction should be within the range between -32768 and 32767, and should be a six-digit binary number. The operand D occupies four word devices. The data is converted as follows. b15 b0 b7 b8 S b15 b0 D D +1 16-bit binary number D +2 If SM690 is OFF, 16#0000 is stored in D +3.
If SM690 is ON, the value in D +3 is unchanged. Besides, if the value in S is a positive value, the sign character in D is 16#20. If the value in S is a negative value, the sign character in D is 16#2D. For example, if the value in S is -12345 and SM690 is OFF, the conversion result is as follows. D +3 b15 b0 b15 b0 b7 b8 D S -12345 D +1 16-bit binary number 4. The value in S used in the 32-bit instruction should be within the range between -2147483648 and 2147483647, and should be an eleven-digit binary number. The operand D occupies six word devices. The data is converted as follows.
D D +2 +3 6-440 API Instruction code Operand Function 2100 D BINDA P S, D Converting the singed decimal number into the ASCII code Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S D Pulse instruction 16-bit instruction (5 steps) 32-bit instruction (5 steps) AH500 AH500 AH500 ASCII code in the ten thousands place Sign (±) ASCII code in the hundreds place ASCII code in the thousands place ASCII code in the units place ASCII code in the tens place Ending character (16#00 or unchanged) 16#31(1) 16#2D(-) 16#33(3) 16#32(2) 16#35(5) 16#34(4) 16#0000