8 APPLICATION INSTRUCTION
8.8 Character String Operation Instruction
465
8
Processing details
• These instructions extract the number of characters specified by (s2)+1 of the character string data stored in the device
specified by (s1) and later from the position specified by (s2), and store the extracted characters in the device specified by
(d) and later.
• A character string stored in (s1) indicates data stored in devices from the specified device until "00H" is first detected in
units of byte.
• A NULL code (00H), which indicates an end of a character string, is automatically added at the end of the character string
data.
• When the number of extracted characters "(s2)+1" is odd, "00H" is stored in the upper byte of a device storing the last
character. When the number of extracted characters "(s2)+1" is even, "0000H" is stored in the device after the last
character.
• If the number of characters specified by (s2)+1 is 0, no processing is performed.
• When (s2)+1 (the number of characters to be extracted) is "-1", the entire character string stored in (s1) and later is stored
to (d) and later.
Precautions
When handling character codes other than ASCII codes, note the following points:
• The number of characters is handled in byte units (8 bits). Accordingly, in the case of character codes in which 2 bytes
express 1 character such as shift JIS codes, 1 character is detected as "2".
• When extracting characters from 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 retrieved if only 1 byte is extracted out of a 2-byte character code.
(1): 5th character position (s2)
(2): ASCII code for 5th character (s2)+1
(1): 5th character position (s2)
41H (A)
42H (B)
43H (C)
44H (D)
45H (E)
46H (F)
47H (G)
48H (H)
45H (E)
46H (F)
47H (G)
48H (H)
49H (I)
4AH (J)
4BH (K)
00H
49H (I)
00H
"ABCDEFGHIJK"
"EFGHI"
b15
b0
b7
b8
b15
b0
b7
b8
(s1)
(s1)+1
(s1)+2
(s1)+3
(s1)+4
(s1)+5
(d)
(d)+1
(d)+2
5
5
(s2)
(s2)+1
(2)
(1)
41H (A)
42H (B)
43H (C)
44H (D)
45H (E)
46H (F)
47H (G)
48H (H)
45H (E)
46H (F)
47H (G)
48H (H)
49H (I)
4AH (J)
4BH (K)
00H
49H (I)
4AH (J)
4BH (K)
00H
"ABCDEFGHIJK"
"EFGHIJK"
(1)
b15
b0
b7
b8
b15
b0
b7
b8
(s1)
(s1)+1
(s1)+2
(s1)+3
(s1)+4
(s1)+5
(d)
(d)+1
(d)+2
(d)+3
5
-1
(s2)
(s2)+1
Summary of Contents for MELSEC iQ-F FX5
Page 1: ...MELSEC iQ F FX5 Programming Manual Instructions Standard Functions Function Blocks ...
Page 2: ......
Page 17: ...15 CONTENTS ...
Page 24: ...22 MEMO ...
Page 1050: ...1048 26 TIME DATA FUNCTIONS 26 4 Division MEMO ...
Page 1068: ...1066 29 COUNTER FUNCTION BLOCKS 29 4 Counter Function Block Operation error There is no error ...
Page 1107: ...I 1105 MEMO ...
Page 1111: ......