Middle String (Mid); Relay Ladder; Structured Text - Allen-Bradley Logix5000 Reference Manual

1756 controllogix, 1768 compactlogix, 1769 compactlogix, 1789 softlogix, 1794 flexlogix, powerflex 700s with drivelogix
Hide thumbs Also See for Logix5000:
Table of Contents

Advertisement

Chapter 18
ASCII String Instructions (CONCAT, DELETE, FIND, INSERT, MID)

Middle String (MID)

MID
Middle String
Source
Qty
Start
Dest
Operand
Type
Source
String
Quantity
SINT
INT
DINT
Start
SINT
INT
DINT
Destination
String
MID(Source,Qty,Start,
Dest);
Description:
Arithmetic Status Flags:
Fault Conditions:
Type
Code
Cause
4
51
The LEN value of the string tag is greater
than the DATA size of the string tag.
4
56
The Start or Quantity value is invalid.
618
The MID instruction copies a specified number of ASCII characters from a string and
stores them in another string.
Operands:

Relay Ladder

?
??
?
??
?
??
?
??
Format
Tag
Immediate
Tag
Immediate
Tag
Tag

Structured Text

The operands are the same as those for the relay ladder MID instruction.
The MID instruction copies a group of characters from the Source and places the result in
the Destination.
·The Start position and Quantity define the characters to copy.
·Unless the Source and Destination are the same tag, the Source remains
unchanged.
Not affected
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Enter
String to copy characters from
Number of characters to copy
Position of the first character
to copy
String to copy the characters
to
Recovery Method
1. Check that no instruction is writing to the LEN member of the string tag.
2. In the LEN value, enter the number of characters that the string contains.
1. Check that the Start value is between 1 and the DATA size of the Source.
2. Check that the Start value plus the Quantity value is less than or equal to the
DATA size of the Source.
Notes
String data types are:
·Default STRING data type
·Any new string data type that you create
The Start plus the Quantity must be less than or
equal to the DATA size of the Source.
Enter a number between 1 and the DATA size of the
Source.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents