Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 619
ASCII String Instructions (CONCAT, DELETE, FIND, INSERT, MID) Chapter 18
Execution:
Example: In a baggage handling conveyor of an airport, each bag gets a bar code. Characters 9…17
of the bar code are the flight number and destination airport of the bag. After the bar
code is read (bag_read.EM is set) the MID instruction copies the flight number and
destination airport to the bag_flt_and_dest string.
Relay Ladder
Structured Text
IF bag_read.EM THEN
MID(bar_barcode,9,9,bag_flt_and_dest);
bag_read.EM := 0;
END_IF;
Condition Relay Ladder Action Structured Text Action
Prescan The rung-condition-out is set to false. No action taken.
Rung-condition-in is false The rung-condition-out is set to false. N/A
Rung-condition-in is true The instruction executes.
The rung-condition-out is set to true.
N/A
EnableIn is set N/A EnableIn is always set.
The instruction executes.
Instruction execution The instruction copies the specified characters from a string and stores them in another string.
Postscan The rung-condition-out is set to false. No action taken.
bag_read.EM
Middle String
Source bag_barcode
'NWA HOP 5058 AMS 01'
Qty 9
Start 9
Dest bag_flt_and_dest
'5058 AMS '
MID