486
RIGHT, RIGHTP, LEFT, LEFTP
LEFT
(1) Stores n number of characters from the left side of the character string (the beginning of the character string) being
stored in devices starting from that whose number is designated by , in devices starting from that whose number
designated by .
When n 7
(2) The NULL code (00
H
) indicating the end of the character string is automatically added to the end of the character string.
Refer to Page 90, Section 3.2.5 for the format of the character string data.
(3) If the number of characters designated by n is "0", the NULL code (00
H
) will be stored at .
Operat
i
on
E
rror
(1) In any of the following cases, an operation error occurs, the error flag (SM0) turns ON, and an error code is stored into
SD0.
Program
E
xamp
l
e
(1) The following program stores 4 characters of data from the rightmost of the character string stored in the area starting
from R0, and stores it into the area starting from D0 when X0 is turned ON.
[Ladder Mode]
[List Mode]
[Operation]
Error
code
Error details
Q00J/
Q00/
Q01
QnH
QnPH QnPRH
QnU
LCPU
4101
The value of n exceeds the number of characters specified by .
The range of the device specified by exceeds the range from to
+ the number of characters specified in n (including ).
––
S
D
+
1
ASC
II
code
for
the
1st
character
ASC
II
code
for
the
2nd
character
ASC
II
code
for
the
3rd
character
ASC
II
code
for
the
4
th
character
ASC
II
code
for
the
(n
-
2)th
character
ASC
II
code
for
the
(n
-
1)th
character
ASC
II
code
for
the
nth
character
ASC
II
code
for
the
(n
+
1)th
character
ASC
II
code
for
the
l
ast
character
00
H
+
1
ASC
II
code
for
the
1st
character
ASC
II
code
for
the
2nd
character
ASC
II
code
for
the
3rd
character
ASC
II
code
for
the
4
th
character
ASC
II
code
for
the
(n
-
2)th
character
ASC
II
code
for
the
(n
-
1)th
character
ASC
II
code
for
the
nth
character
00
H
S
S
D
b15
b8b7
b0
D
b15
b8b7
b0
+
1
4
1
H
(A)
4
2
H
(B)
4
3
H
(C)
44
H
(D)
+
2
4
5
H
(
E
)
4
6
H
(
F
)
ASC
II
code
for
the
7th
character
"
ABCD
EF
1
"
+
3
31
H
(1)
00
H
+
1
4
1
H
(A)
4
2
H
(B)
4
3
H
(C)
44
H
(D)
4
5
H
(
E
)
4
6
H
(
F
)
31
H
(1)
32
H
(2)
33
H
(3)
3
4
H
(
4
)
35
H
(5)
00
H
+
2
+
3
+4
+
5
"
ABCD
EF
123
4
5
"
b15
b8b7
b0
S
S
S
S
S
S
D
D
D
b15
b8b7
b0
D
D
S
D
D
D
D
I
nstruct
i
on
De
vi
ce
Step
R1
4
2
H
(B)
4
1
H
(A)
32
H
(2)
31
H
(1)
D1
30
H
(0)
4
5
H
(
E
)
4
6
H
(
F
)
4
1
H
(A)
30
H
(0)
4
5
H
(
E
)
4
6
H
(
F
)
4
1
H
(A)
00
H
R2
R3
R
4
D2
00
H
ASC
II
code
for
the
4
th
character
"
BA210
EF
A
"
"
0
EF
A
"
R0
D0
b15
b8b7
b0
b15
b8b7
b0