Publication 1766-RM001A-EN-P - October 2008
386
ASCII Instructions
ASC - String Search
Instruction Type: output
Use the ASC instruction to search an existing string for an occurrence of
the source string. This instruction executes on a true rung.
Entering Parameters
Enter the following parameters when programming this instruction:
•
Source
is the address of the string you want to find.
•
Index
is the starting position (from 1…82) within the search string.
(An index of 1 indicates the left-most character of the string.)
•
Search
is the address of the string you want to examine.
•
Result
is the location (from 1…82) that the controller uses to store
the position in the Search string where the Source string begins. If
no match is found, result is set equal to zero.
Addressing Modes and File Types can be used as shown below:
TIP
For information on the timing of this instruction, see the timing diagram on
page 389.
ASC
String Search
Source
ST10:6
Index
5
String Search
ST10:7
Result
N7:1
0<
ASC
Execution Time for the ASC Instruction
Controller
When Instruction Is:
True
False
MicroLogix 1400r
8.0844 µs
0.1984 µs
ASC Instruction Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page 92.
Parameter
Data Files
(1)
Function Files
CS
- Comms
IO
S - I/O
DL
S
-
D
a
ta
L
o
g
Address
Mode
Address Level
O
I
S
B
T,
C
, R
N
F
ST
L
MG,
PD
RI
/RIX
PL
S
RTC
HS
C
PTO
X
, PWMX
STI
EII
BH
I
MMI
LC
D
Im
mediate
Dir
ect
Indir
e
c
t
Bi
t
Wo
rd
Lo
ng
W
o
rd
Elemen
t
Source
•
•
•
•
•
•
•
•
Index
•
•
•
•
Search
•
•
•
Result
•
•
•
•
•
•
•
•
(1) The Control data file is the only valid file type for the Control Element.
efesotomasyon.com - Allen Bradley,Rockwell,plc,servo,drive