495
STRDEL, STRDELP
1
2
3
4
4
6
7
8
7.11 Character string processing instructions
7.11.19 STRDEL, STRDELP
Function
(1) This instruction deletes n2 characters data in the devices specified by starting from the device (insert position)
specified by n1.
Device position where character string data to be deleted: n1 3
Number of characters to be deleted: n2 5
(2) This instruction stores the NULL code (00
H
) into the device (one word) that positions after the last device that stores the
character string data when the character string data specified by is even, after the characters are deleted.
(3) This instruction stores the NULL code (00
H
) into the last device (high 8 bits) that stores the character string data when
the character string data specified by is odd, after the characters are deleted.
(4) This instruction shifts the characters stored in the devices that position after the deleted devices by n2 characters to the
right, and then stores the NULL code (00
H
) into the empty device.
Operation Error
(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 Example
(1) The following program deletes the fourth to the seventh characters in the character string data stored in the devices D0
and up, when M0 is turned on.
[Ladder Mode] [List Mode]
Error
code
Error details
Q00J/
Q00/
Q01
QnH QnPH QnPRH QnU LCPU
4100
The number of characters in the devices specified by exceeds
16383.
The value specified by n1 is not within the range. (1 n1 16383)
The value specified by n1 exceeds the number of characters in the
devices specified by .
The value specified in n2 exceeds the number of characters between
n1 and the last character in .
The value specified in n2 is negative.
–– –– –– ––
D
n1th character
to be deleted
The characters of the devices other than
the shifted devices do not change.
Stores the NULL code (00
H) into
the empty devices after shifting.
+1
41
H
(A)42
H
(B)
48
H
(H)49
H
(I)
4A
H
(J)4B
H
(K)
4C
H
(L)00
H
00
H
00
H
00
H
31
H
(1) 30
H
(0)
33
H
(3) 32
H
(2)
35
H
(5) 34
H
(4)
+2
+3
+4
+5
b15 b8b7 b0
D
D
D
D
D
D
D
+6
D
+7
D
+8
D
+9
D
Shifts the n1+n2th characters and up,
which are stored after the devices whose characters
were deleted, by n2 characters to the right
+1
41
H
(A)42
H
(B)
49
H
(I)
48
H
(H)
4A
H
(J)
4C
H
(L) 4B
H
(K)
00
H
31
H
(1) 30
H
(0)
33
H
(3) 32
H
(2)
35
H
(5) 34
H
(4)
+2
+3
+4
+5
b15 b8b7 b0
D
D
D
D
D
D
+6
D
+7
D
+8
D
+9
D
Deletes n2 characters from
the n1th device and up
+1
41
H
(A)42
H
(B)
43
H
(C)44
H
(D)
45
H
(E)46
H
(F)
48
H
(H) 47
H
(G)
4A
H
(J) 49
H
(I)
4C
H
(L) 4B
H
(K)
00
H
31
H
(1) 30
H
(0)
33
H
(3) 32
H
(2)
35
H
(5) 34
H
(4)
+2
+3
+4
+5
b15 b8b7 b0
D
D
D
D
D
D
+6
D
+7
D
+8
D
+9
D
D
D
D
D
D
Step
Instruction
Device