AH500 Programming Manual 
6-486 
API    Instruction code
Operand 
Function 
2116    $RPLC  P 
S
1
, S
2
, S
3
, S
4
, D 
Replacing the characters in the string
Device
X  Y  M  S  T  C  HC  D  L  SM  SR  E  PR  K  16#
“$”  DF 
Pulse instruction  16-bit instruction (11-17 steps)
32-bit instruction
AH500  AH500  - 
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 
:
1
character indicated by the value in S
4
 
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 “1234567890” are replaced 
by “MN”, and the result is “12345MN0”. 
 After the instruction 
 is executed
 b15
 b0
 b7 b8
 0016#
 S1+1
 S1+2
 S1+3
16#31(1) 16#32(2)
16#33(3) 34(4)16#
 36(6)16#
 35(5)16#
 37(7)16#
 38(8)16#
 39(9)16#
 S1+4
 b15
 b0
 b7 b8
 0016#
16#4D(M)
 4E(N)16#
 S1+5
 30(0)16#
 4
 6
16#31(1) 32(2)16#
 33(3)16# 34(4)16#
 4D(M)16#
 35(5)16#
 4E(N)16#
 30(0)16#
 000016#
 Character which is replaced
 N
umber of characters which are replaced
 S1
 S2
 S2+1
 S3
 S4
 D+1
 D+2
 D+3
 D+4
 D
 Ignored
 Ignored
 
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.