Publication 1762-RM001C-EN-P
ASCII Instructions 20-19
AEX - String Extract
Instruction Type: output
The AEX instruction creates a new string by taking a portion of an existing
string and storing it in a new string.
Entering Parameters
Enter the following parameters when programming this instruction:
•
Source is the existing string. The Source value is not affected by this
instruction.
•
Index is the starting position (from 1 to 82) of the string you want to
extract. (An index of 1 indicates the left-most character of the string.)
•
Number is the number of characters (from 1 to 82) you want to
extract, starting at the indexed position. If the Index plus the Number
is greater than the total characters in the source string, the Destination
string will be the characters from the Index to the end of the Source
string.
•
Destination is the string element (ST) where you want the extracted
string stored.
Addressing Modes and File Types can be used as shown below:
AEX
String Extract
Source ST10:0
Index 1
Number 5
Dest ST10:3
AEX
Table 20.19 Execution Time for the AEX Instruction
Controller When Instruction Is:
True False
MicroLogix 1200 Series B, FRN 3 or later 14.8
µ
s + 2.9
µ
s/character 0.0
µ
s
MicroLogix 1500 Series B, FRN 4 or later 12.4
µ
s + 2.6
µ
s/character 0.0
µ
s
Table 20.20 AEX Instruction Valid Addressing Modes and File Types
For definitions of the terms used in this table see Using the Instruction Descriptions on page4-2.
Parameter
Data Files
(1)
(1) The Control data file is the only valid file type for the Control Element.
Function Files
CS - Comms
IOS - I/O
Address
Mode
Address
Level
O
I
S
B
T, C, R
N
ST
L
MG, PD
RTC
HSC
PTO, PWM
STI
EII
BHI
MMI
DAT
TPI
Immediate
Direct
Indirect
Bit
Word
Long Word
Element
Source • • •
Index •• •••
• •
Number •• •••
• •
Destination •
• •