FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
26.5
FNC204 – RIGHT / Extracting Character String Data from the Right
Outline
This instruction extracts a specified number of characters from the right end of a specified character string.
1. Instruction format
FNC 204
RIGHT
2. Set data
Operand Type
S
D
n
3. Applicable devices
Bit Devices
Oper-
and
System User
Type
X Y M T C S D .b KnX KnY KnM KnS
S
D
n
Explanation of function and operation
1. 16-bit operation (RIGHT and RIGHTP)
"n" characters are extracted from the right end (that is, from the end) of the character string data stored in
later, and stored to
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.
Command
input
b15----------------------b8b7-----------------------b0
ASCII code for 2nd
S
ASCII code for 4th
S
+1
character -n+2)"th character
character -n+4)"th character
character -1)"th character
628
Mnemonic
16-bit Instruction
P
RIGHT
7 steps
RIGHTP
Head device number storing a character string
Head device number storing extracted character string
Number of characters to be extracted
Digit Specification
D
and later.
FNC204
S
D
RIGHT
ASCII code for 1st
character
character
ASCII code for 3rd
character
character
ASCII code for "(last
ASCII code for "(last
character -n+1)"th character
ASCII code for "(last
ASCII code for "(last
character -n+3)"th character
ASCII code for "(last
ASCII code for "(last
character -2)"th character
ASCII code for last
00H
character
26 Character String Control – FNC200 to FNC209
26.5 FNC204 – RIGHT / Extracting Character String Data from the Right
→ For handling of character strings, refer to Section 5.3.
Operation Condition
32-bit Instruction
Continuous
Operation
Pulse (Single)
Operation
Description
Word Devices
Special
System User
Unit
T
C D R U \G
n
b15----------------------b8b7-----------------------b0
D
character -n+2)"th character
D
+1
character -n+4)"th character
Mnemonic
Operation Condition
⎯
⎯
Character string
Others
Con-
Real
Index
stant
Number
V
Z Modify K
H
E
D
.
ASCII code for "(last
ASCII code for "(last
character -n+1)"th character
ASCII code for "(last
ASCII code for "(last
character -n+3)"th character
ASCII code for "(last
ASCII code for "(last
character -1)"th character
character -2)"th character
ASCII code for last
00H
Data Type
16-bit binary
Charac-
Pointer
ter String
" "
P
and
S
character