Delta AH500 — 6.21.2 Explanation of String Processing Instructions

Chapter 6 Applied Instructions Symbol: S 1 : String which is replaced Word S 2 : New string Word S 3 : Number of characters in S 1 which are replaced Word S 4 : The characters in S 1 starting from the character indicated by the value in S 4 are replaced. Word D : Device in which the execution result is stored Word Explanation: 1. The characters in S 1 starting from the character indicated by the value in S 4 are replaced by the characters in S 2 , the number of characters which are replaced is indicated by the value in S 3 , and the result is stored in D . 2.

The four characters starting from the sixth character in the string “12345 6789 0” are replaced by “MN”, and the result is “12345 MN 0”. S1 b15 b0 b7 b8 b15 b0 b7 b8 D S1+1 D+1 S1+2 S1+3 After the instruction is executed D+2 D+3 S1+4 D+4 S1+5 S2 S2+1 S3 4 Number of characters which are replaced 3. If the string in S 2 is 16#00, the instruction has the function of deleting the characters. 4. If the value in S 3 is larger than the number of characters which can be replaced in the string in S 1 , the characters in S 1 starting from the character indicated by the value in S 4 to the last character in S 1 are replaced.

S4 6 Character which is replaced 6-487 API Instruction code Operand Function 2116 $RPLC P S , S , S , S , D 1 2 3 4 Replacing the characters in the string Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1          S 2           S 3             S 4             D         Pulse instruction 16-bit instruction (11-17 steps) 32-bit instruction AH500 AH500 - 16#32(2) 16#31(1) 16#34(4) 16#33(3) 16#36(6) 16#35(5) 16#38(8) 16#37(7) 16#30(0) 16#39(9) Ignored 16#00 16#32(2) 16#31(1) 16#34(4) 16#33(3) 16#4D(M) 16#35(5) 16#30(0) 16#4E(N) 16#0000 16#4E(N) 16#4D(M) Ignored 16#00