WINSERT

WINSERT 1:

The function WINSERT adds a WString in another WString from a particular location.
WINSERT (STR1, STR2, POS) means: Add STR2 in STR1 after the POSth position.

FUNCTION WINSERT: WSTRING (255)

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

Example in IL:

LD “SUSI“
WINSERT “XY“,2
ST Var1 (*Result is “SUXYSI“*)

Example in ST:

Var1 := WINSERT (“SUSI“,“XY“,2);

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard