LEN

LEN 1:

The function LEN returns the length of a string.

FUNCTION LEN: INT

VAR_INPUT
    STR : STRING(255);
END_VA

Example in IL:

LD 'SUSI'
LEN
ST Var1 (* Result is 4 *)

Example in ST:

Var1 := LEN ('SUSI');

Requirements

Development environment

Target platform

PLC library to include

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Standard