628
FX3S/FX3G/FX3GC/FX3U/FX3UC Series
Programming Manual - Basic & Applied Instruction Edition
26 Character String Control – FNC200 to FNC209
26.6 FNC205 – LEFT / Extracting Character String Data from the Left
26.6 FNC205 – LEFT / Extracting Character String Data from the Left
Outline
This instruction extracts a specified number of characters from the left end of a specified character string.
→ For handling of character strings, refer to Section 5.3.
1. Instruction format
2. Set data
3. Applicable devices
Explanation of function and operation
1. 16-bit operation (LEFT and LEFTP)
“n” characters are extracted from the left end (that is, from the head) of the character string data stored in and
later and stored to and later.
If the number of characters specified by “n” is “0”, the NULL code (0000H) is stored to .
When characters are extracted from a character string, "00H” is automatically added at the end of the extracted
characters.
- When the number of extracted characters is odd, “00H” is stored in the high-order byte of a device storing the
last character.
- When the number of extracted characters is even, “0000H” is stored in the device after the last character.
Operand Type Description Data Type
Head device number storing a character string
Character string
Head device number storing extracted character string
n Number of characters to be extracted 16-bit binary
Oper-
and
Type
Bit Devices Word Devices Others
System User Digit Specification System User
Special
Unit
Index
Con-
stant
Real
Number
Charac-
ter String
Pointer
XYMTCSD
.b KnX KnY KnM KnS T C D R
U\G
V Z Modify K H E "
"P
n
P
FNC 205
LEFT
Mnemonic Operation Condition
16-bit Instruction
7 steps
LEFT
LEFTP
Mnemonic Operation Condition
Continuous
Operation
Pulse (Single)
Operation
32-bit Instruction
⎯
⎯
S
D
S
D
S
D
D
FNC205
LEFT
b15----------------------b8b7-----------------------b0
+1
ASCII code for 2nd
character
ASCII code for 4th
character
D
S
S
n
ASCII code for 1st
character
ASCII code for 3rd
character
ASCII code for n-1
character
ASCII code for n-2
character
+1
D
ASCII code for n+1
character
ASCII code for n
character
00H
ASCII code for last
character
b15----------------------b8b7-----------------------b0
ASCII code for 2nd
character
ASCII code for 4th
character
ASCII code for 1st
character
ASCII code for 3rd
character
ASCII code for n-1
character
ASCII code for n-2
character
00H
ASCII code for n
character
Command
input
D
S