Codesys Split String Jun 2026
// Split the string using semicolon as delimiter iResult := StrSplit(sInput, ';', aOutput, SIZE_OF(aOutput), iCount); // iCount now equals 3 // aOutput[1] = "Temperature"
Unlike high-level languages like Python (which has a built-in .split() method) or C# (which has String.Split ), CODESYS (based on IEC 61131-3) does have a dedicated standard library function called SplitString . Instead, engineers must build this functionality using standard string functions. codesys split string
VAR iPos : INT; iStartIdx : INT; iTokenIdx : INT; iDelimLen : INT; sWork : STRING(255); iFound : INT; END_VAR // Split the string using semicolon as delimiter