CODESYS LEFT

LEFT is a string function that returns a specified number of characters from the start of a string. It takes a STRING(255) input and an INT size, and returns a STRING(255); LEFT('SUSI',3) returns 'SUS'.

Source checked9/9 values · 2026-10-26

Specification

2 sources
Languageiec 61131 3
CodeLEFT
GroupString Functions
SyntaxLEFT (STR, SIZE)
DialectCODESYS

Parameters

NameData typeDescription
STRSTRING(255)String to be analyzed
SIZEINTNumber of characters

Study notes

  • The function declaration is FUNCTION LEFT : STRING(255).
  • The return value is a STRING(255) resulting string.
  • Example: VarSTRING1 := LEFT('SUSI',3); the result is 'SUS'.
↑↓ navigate↵ openesc close