RIGHT

RIGHT 1:

The function RIGHT returns the right, initial string for a given string.
RIGHT (STR, SIZE) means: Take the first SIZE character from the right in the string STR.

FUNCTION RIGHT: STRING (255)

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

Example in IL:

LD 'SUSI'
RIGHT 3
ST Var1 (* Result is 'USI' *)

Example in ST:

Var1 := RIGHT ('SUSI',3);

Requirements

Development environment

Target system type

PLC libraries to be linked

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard