INSERT (insert string)

The INSERT instruction inserts sub-strings at user-defined positions within strings.
Languages supported: Function block diagram, ladder diagram, structured text.
This instruction applies to the Micro810, L20E, L50E, and L70E controllers.
INSERT
INSERT
INSERT parameters
Parameter
Parameter Type
Data Type
Description
EN
Input
BOOL
Instruction enable.
  • TRUE: Insert sub-strings in a string.
  • FALSE: No operation.
Applies to ladder diagram programs.
IN
Input
STRING
Initial string.
Str
Input
STRING
String to be inserted.
Pos
Input
DINT
Position of the insertion is done before the position (first valid position is 1).
INSERT
Output
STRING
Modified string. Can be:
  • Empty string if Pos <= 0.
  • Concatenation of both strings if Pos is greater than the length of the IN string.
ENO
Output
BOOL
Enable output.
Applies to ladder diagram programs.

INSERT examples

INSERT function block diagram example
INSERT function block diagram example
INSERT ladder diagram example
INSERT ladder diagram example
INSERT structured text example
INSERT structured text example
(* ST Equivalence: *) MyName := INSERT ('Mr JONES', 'Frank ', 4); (* MyName is 'Mr Frank JONES' *)
Results
Results
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal