INSERT

INSERT 1:

The function INSERT inserts a string into another string at a defined point.
INSERT (STR1, STR2, POS) means: Insert STR2 into STR1 after position POS.

FUNCTION INSERT: STRING (255)

VAR_INPUT
    STR1 : STRING(255);
    STR2 : STRING(255);
    POS  : INT;
END_VAR

Example in IL:

LD 'SUSI'
INSERT 'XY',2
ST Var1 (* Result is 'SUXYSI' *) 

Example in ST:

Var1 := INSERT('SUSI','XY',2); 

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard