332
8
–1
To replace starting from the eighth place,
but only 5 characters are effective.
Since the D21= –1,
all of the 7
characters at the
will be taken.
S1
D10
D11
D12
D13
00H
20H( )
45H( E)
49H
I
( )
4CH( L)
20H( )
D14
D15
D
31H(1 )
49H
I
( )
4BH K( )
D16
56H(V)
45H( E)
4CH( L)
4FH
O
( )
D0
D1
D2
D3
56H(V)
" LOVE168"
D20
D21
S1
S2
45H( E)
4CH( L)4FH
O
( )
31H(1 )36H(6 )
38H(8 )
00H
X0=ON
" I LIKE VIGOR"
D10
D11
D12
D13
00H
20H( )
45H( E)
49H
I
( )
49H
I
( )
4CH( L)
4BH K( )
20H( )
4FH
O
( )
49H
I
( )47H(G)
52H R( )
56H(V)
D14
D15
D16
D
If the operation has one of the following situation, the PLC will regard that as an operational error.
1. The string from or which does not have the end of string code “00H”.
2. The designated starting location is not in the string or the is negative.
3. The value of +1 is exceeding the string from could provide with or the +1 is less than –1.
S1
S2
S2
S1
S2
D
D
S2
If the D21 = –1, this instruction will extract all the characters at the source string . As the example below, the
characters “LOVE168” are caught.
S1
If use the extracted characters to replace a part of string and that range is exceeded the string have, the
replacement will only affect to the original occupied space, as the example below.
D
Upper
8 bits
Lower
8 bits
Upper
8 bits
Lower
8 bits
Upper
8 bits
Lower
8 bits
D