Publication 1763-RM001C-EN-P - October 2009
ASCII Instructions
333
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 to 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 to 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:
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 1100r
45.18
μ
s + 1.62
μ
s/matching
character
0.87
μ
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 82.
Parameter
Data Files
(1)
Function Files
CS - Com
m
s
IOS - I/O
DLS
-
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
PLS
RTC
HSC
PTO, PW
M
STI
EII
BH
I
MMI
LCD
Immedia
te
Dir
e
c
t
Indir
e
ct
Bit
Wo
rd
Long W
o
rd
Ele
m
ent
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