Справочник Пользователя для Mitsubishi Electronics MELSEC -Q/L

Скачать
Страница из 1086
7  APPLICATION INSTRUCTIONS
7.11  Character String Processing Instructions
577
7
Extracting character string data from the right, extracting 
character string data from the left
RIGHT(P), LEFT(P)
Processing details
RIGHT
 • Stores n number of characters from the right side of the character string (the end of the character string) being stored in 
devices starting from that whose number is designated by (S), in devices starting from that whose number is designated by 
(D).
When n=5
 • The NULL code (00H) indicating the end of the character string is automatically added to the end of the character string. 
Refer to Page 92 Using character string data for the format of the character string data.
 • If the number of characters designated by n is "0", the NULL code (00H) will be stored at (D).
(S):   Character string or head number of the devices where the character string is stored (character string)
(D):   Head number of the devices where the character string consisting of n characters starting from the right or left of (S) will be stored (character string)
n:  
Number of characters to be extracted (BIN 16 bits)
Setting 
data
Internal device
R, ZR
J\
U\G
Zn
Constant
Others
Bit
Word
Bit
Word
K, H
$
(S)
(D)
n
Process
High
performance
Redundant Universal
LCPU
Basic
Command
P
n
n
S
D
Command
RIGHTP, LEFTP
RIGHT, LEFT
i
ndicates an instruction symbol of RIGHT/LEFT.
S
D
+
1
ASCII code for the 1st character
ASCII code for the 2nd character
ASCII code for the 3rd character
ASCII code for the 4th character
ASCII code for the (last - n + 1)th character
ASCII code for the (last - n + 2)th character
ASCII code for the (last - n + 3)th character
ASCII code for the (last - n + 4)th character
ASCII code for the (last - 2)th character
ASCII code for the (last - 1)th character
ASCII code for the last character
00
H
+
1
ASCII code for the (last - n + 1)th character
ASCII code for the (last - n + 2)th character
ASCII code for the (last - n + 3)th character
ASCII code for the (last - n + 4)th character
ASCII code for the (last - 2)th character
ASCII code for the (last - 1)th character
ASCII code for the last character
00
H
b15
b8b7
b0
S
S
b15
b8b7
b0
D
D
+1
41
H
 (A)
42
H
 (
B)
43
H
 (
C)
44
H
 (D)
+1
31
H
 (1)
32
H
 (2)
33
H
 (3)
34
H
 (4)
45
H
 (E)
46
H
 (F)
31
H
 (1)
32
H
 (2)
33
H
 (3)
34
H
 (4)
35
H
 (5)
00
H
+2
+3
+4
+5
+2
35
H
 (5)
00
H
A
SCII code for the 5th character
"A
BCDEF12345"
"12345"
b15
b8b7
b0
S
S
S
S
S
S
D
D
D
b15
b8b7
b0