WLEFT

WLEFT 1:

The function WLEFT supplies a left-hand start string for a WSTRING.
WLEFT (STR, SIZE) means: Take the first SIZE characters from the left in WString STR.

FUNCTION WLEFT: WSTRING (255)

VAR_INPUT
    STR  : WSTRING(255);
    SIZE : INT;
END_VAR

Example in IL:

LD “SUSI“
WLEFT 3
ST Var1 (*Result is “SUS“*)

Example in ST:

Var1 := WLEFT (“SUSI“,3);

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard