WMID

WMID 1:

The function WMID supplies a substring of a WSTRING.
WMID(STR, LEN, POS) means: Fetch LEN characters from WSTRING STR beginning with the character at position POS.

FUNCTION WMID: WSTRING (255)

VAR_INPUT
    STR : WSTRING(255);
    LEN : INT;
    POS : INT;
END_VAR

Example in IL:

LD “SUSI“
WMID 2,2
ST Var1 (*Result is “US“*)

Example in ST:

Var1 := WMID (“SUSI“,2,2);

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard