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 - Comms
IOS - I/O
DLS - Data Log
Address
Mode
Address Level
O
I
S
B
T, C, R
N
F
ST
L
MG, PD
RI/RIX
PLS
RTC
HSC
PTO, PWM
STI
EII
BHI
MMI
LCD
Immediate
Direct
Indirect
Bit
Word
Long Word
Element
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