LEFT
Left returns the left, initial string for a given string. LEFT (STR, SIZE) means: Take the first SIZE character from the right in the string STR.
FUNCTION LEFT :STRING(255)
VAR_INPUT
STR :STRING(255);
SIZE :INT;
END_VAR
Example in IL:
LD 'SUSI'
LEFT 3
ST Var1 (* Result is 'SUS' *)
Example in ST:
Var1 := LEFT ('SUSI',3);
Requirements
Development environment |
Target system type |
PLC libraries to include |
---|---|---|
TwinCAT Version >= 2.6.0 |
PC or CX (x86) |
Standard.Lib |
TwinCAT Version >= 2.6.0 |
BC (165) |
Standard.Lb6 |
TwinCAT Version >= 2.9.0 |
BCxx50 or BX |
Standard.lbx |
TwinCAT Version >= 2.10.0 Build >= 1301 |
CX (ARM) |
Standard.lib |