14.32 ESSRC (String Search: With Storage Area Size)
■
Ladder diagram
■
List of operands
Operand Description
S1
Starting device address of the string data to be searched for (available range: 0 to 65534; for
character constant: 0 to 256 characters)
p Starting search position of the string to be searched for (available range: 1 to 65534)
S2
Starting device address of the string to be searched (available range: 1 to 65534; for character
constant: 0 to 256 characters)
D Starting device address to store the search result
■
Available devices (●: Available)
Operan
d
16-Bit device:
32-Bit
device:
Integer
Real
numbe
r
St
rin
g
Index
modifie
r
(Note 1)
W
X
W
Y
W
R
W
L
W
S
S
D
D
T
L
D
U
M
WI
W
O
TS
C
S
TE
C
E
IX K U H SF
D
F
" "
S1 ● ● ● ● ● ● ● ●
p ● ● ● ● ● ● ● ● ● ●
S2 ● ● ● ● ● ● ● ●
D ● ● ● ● ● ● ● ● ●
(Note 1) Only 16-bit devices, and integer constants can be modified. (Character constants cannot be specified.)
■
Outline of operation
● This instruction searches for the string data specified by [S1] in the string table starting from
[S2].
● For [p], specify the relative position (by byte) in the string table where the search starts.
● For the search result, the number of same character data is stored in the device whose
address is specified by [D], and the relative position (by byte) of the first match is stored in [D
+1].
■
Processing
Example 1) Searching for string "EFG" stored in DT0, in the string table from DT10
[S1]...DT0 [p]...U1 [S2]...DT10 [S2]...DT120
14.32 ESSRC (String Search: With Storage Area Size)
14-126 WUME-FP7CPUPGR-12