624
FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
26 Character String Control – FNC200 to FNC209
26.8 FNC207 – MIDW / Random Replacement of Character Strings
• When
+1 (the number of characters to be extracted) is “-1”, the entire character string stored in
and later is stored to
and later.
Cautions
This instruction can handle character codes other than ASCII codes, but please note the following:
• The number of characters is handled in units of byte (8 bits). Accordingly, in the case of character codes in
which 2 bytes express 1 character such as shift JIS codes, the length of 1 character is detected as “2”.
• When overwriting a character string including character codes in which 2 bytes express 1 character such
as shift JIS codes, consider the number of characters to be extracted in units of character codes for 1
character.
Note that the expected character code is not given if only 1 byte is overwritten out of a 2-byte character
code.
Errors
An operation error is caused in the following cases; The error flag M8067 turns ON, and the error code is
stored in D8067.
• When “00H” is not set within the corresponding device range after a device specified by
or
(error code: K6706)
• When the value specified by
exceeds the number of characters of the character string stored in
and later (error code: K6706)
• When the number of characters specified by
+1 exceeds the number of characters specified by
(error code: K6706)
• When
specifies a negative value (error code: K6706)
• When
+1 specifies “-2” or less (error code: K6706)
S
2
S
1
D
1st
character
42H(B)
44H(D)
43H(C)
46H(F)
45H(E)
47H(G)
30H(0)
35H(5)
35H(5)
34H(4)
32H(2)
31H(1)
34H(4)
33H(3)
31H(1)
30H(0)
33H(3)
32H(2)
+1
+2
+3
b15---------------b8b7-----------------b0
“012345”
+1
+2
b15---------------b8b7-----------------b0
00H
41H(A)
“ABCDEFGHIJK”
+1
-1
2
+3
+4
48H(H)
4AH(J)
49H(I)
+1
+2
b15---------------b8b7-----------------b0
41H(A)
“A012345HIJK”
+3
+4
4AH(J)
49H(I)
48H(H)
+5
00H
4BH(K)
+5
00H
4BH(K)
2nd
character
Six characters from the 2nd
character are overwritten.
2nd
character
After execution
Before execution
1st
character
Last character
S
1
S
1
S
1
S
1
S
2
S
2
D
D
D
D
D
D
D
D
D
D
D
Position from the left end in the
character string stored in and later
Number of characters from the left end
in the character string stored in
and later
S
1
S
1
D
S
2
D
S
2
S
1
S
2
S
2