616 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 18 ASCII String Instructions (CONCAT, DELETE, FIND, INSERT, MID)
Insert String (INSERT)
The INSERT instruction adds ASCII characters to a specified location within a string.
Operands:
Relay Ladder
Structured Text
The operands are the same as those for the relay ladder INSERT instruction.
Description: The INSERT instruction adds the characters in Source B to a designated position within
Source A and places the result in the Destination.
• Start defines where in Source A that Source B is added.
• Unless Source A and the Destination are the same tag, Source A remains
unchanged.
Arithmetic Status Flags: Not affected
Fault Conditions:
Insert String
Source A ?
??
Source B ?
??
Start ?
??
Dest ?
??
INSERT
Operand Type Format Enter Notes
Source A String Tag String to add the characters to String data types are:
·Default STRING data type
·Any new string data type that you create
Source B String Tag String containing the
characters to add
Start SINT
INT
DINT
Immediate
Tag
Position in Source A to add the
characters
Enter a number between 1 and the DATA size of the
Source.
Result String Tag String to store the result
INSERT(SourceA,SourceB,
Start,Dest);
Type Code Cause Recovery Method
4 51 The LEN value of the string tag is greater
than the DATA size of the string tag.
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.
4 56 The Start value is invalid. Check that the Start value is between 1 and the DATA size of the Source.