Mitsubishi Electric MELSEC FX3U Programming Manual page 660

Melsec fx series programmable logic controllers
Table of Contents

Advertisement

FX
/FX
/FX
Series Programmable Controllers
3G
3U
3UC
Programming Manual - Basic & Applied Instruction Edition
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
and later, and stored to
S
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
In the case of "n = 5"
b15----------------------b8b7-----------------------b0
S
S
+1
S
+2
S
+3
S
+4
S
+5
• A character string stored in
"00H" is first detected in byte units.
Cautions
When handling character codes other than ASCII codes, note the following contents:
• 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, the length of 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 given if only 1 byte is executed out of a 2-byte character code.
658
and later.
D
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
42H(B)
41H(A)
44H(D)
43H(C)
46H(F)
45H(E)
32H(2)
31H(1)
34H(4)
33H(3)
00H
35H(5)
"ABCDEF12345"
and later indicates data stored in devices from the specified device until
S
26 Character String Control – FNC200 to FNC209
26.5 FNC204 – RIGHT / Extracting Character String Data from the Right
n
b15----------------------b8b7-----------------------b0
D
character -n+2)"th character
D
+1
character -n+4)"th character
b15----------------------b8b7-----------------------b0
D
D
+1
D
+2
ASCII code for 5th character
ASCII code for 1st character
.
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
character
32H(2)
31H(1)
34H(4)
33H(3)
00H
35H(5)
"12345"

Advertisement

Table of Contents
loading

This manual is also suitable for:

Melsec fx3ucMelsec fx3g

Table of Contents