L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 642

Advertising
background image

L-force | PLC Designer

PLC Designer Libraries

640

DMS 3.2 EN 02/2011 TD29



Example in IL:

LD 'SUSI'

RIGHT 3

ST VarSTRING1 (* Result is 'USI' *)

Example in FBD:

Example in ST:

VarSTRING1 := RIGHT ('SUSI',3);

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.

MID

Provided by standard.lib.

Mid returns a partial string from within a string.

Input STR is type STRING, LEN and POS are type INT, the return value of the function is
type STRING.

MID (STR, LEN, POS) means: Retrieve LEN characters from the STR string beginning
with the character at position POS.

Example in IL:

LD 'SUSI'

MID 2,2

ST VarSTRING1 (* Result is 'US' *)

Advertising