LEN¶
Provided by standard.lib.
Returns the length of a string. Input STR is of type STRING, the return value of the function is type INT.
Example in IL
LD ‘SUSI’
LEN
ST VarINT1 (* Result is 4 *)
Example in FBD
Example in ST
VarSTRING1 := LEN (‘SUSI’);
Note
String functions are not “thread safe”: When using tasks, string functions may only be used in a single task. If the same function is used in different tasks, there is a danger of overwriting.