WRIGHT

WRIGHT 1:

WRIGHT supplies a right-hand start string for a WSTRING.
WRIGHT (STR, SIZE) means: Take the first SIZE characters from the right in WString STR.

FUNCTION WRIGHT: WSTRING (255)

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

Example in IL:

LD “SUSI“
WRIGHT 3
ST Var1 (*Result is “USI“*)

Example in ST:

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

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard