AH500 Programming Manual API 2114 Symbol: S 2 : Part of the string which is S 1 : String Word replaced Word D : String which is replaced Word Explanation: 1. S 2 : The initial character in D which is replaced S 2 +1: The number of characters which are retrieved from S 1 2. The retrieve of the characters in the string in S 1 begins from the first character, and the value in S 2 +1 indicates the number of characters which are retrieved from the string in S 1 . The characters which are retrieved from the string in S 1 replace the characters in D starting from the character indicated by the value in S 2 .
b15 b0 b7 b8 b15 b0 b7 b8 +1 S1 S1 D +1 D +2 S1 +2 D +3 S1 +4 S1 +4 D +3 D After the instruction is executed S2 +1 S2 3 6 Number of characters which are retrieved from S1 Initial character in D which is replaced b15 b0 b7 b8 D +1 D +2 D +4 D +3 D 3. If the value in S 2 +1 is 0, the instruction is not executed. 4. If the value in S 2 +1 is larger than the length of the string in D , the characters in D which are replaced start from the character indicated by the value in S 2 to the last character in D .
6-482 Instruction code Operand Function $MIDW P S , S , D 1 2 Replacing a part of the string Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1 S 2 D Pulse instruction 16-bit instruction (7-13 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#00 16#39(9) 16#46(F) 16#45(E) 16#48(H) 16#47(G) 16#4A(J) 16#49(I) 16#4C(L) 16#4B(K) 16#00 16#4D(M) 16#46(F) 16#45(E) 16#32(2) 16#31(1) 16#34(4) 16#33(3) 16#36(6) 16#35(5) 16#00 16#4D(M)