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

Page 647

Advertising
background image

L-force | PLC Designer

PLC Designer Libraries



DMS 3.2 EN 02/2011 TD29

645

Example in ST:

VarSTRING1 := REPLACE ('SUXYSI','K',2,2);

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.

FIND

Provided by standard.lib.

FIND searches for a partial string within a string.

The input variable STR1 and STR2 are type STRING, the return value of the function is
type STRING.

FIND(STR1, STR2) means: Find the position of the first character where STR2 appears
in STR1 for the first time. If STR2 is not found in STR1, then OUT:=0.

Example in IL:

LD 'abcdef'

FIND 'de'

ST VarINT1 (* Result is '4' *)

Example in FBD:

Advertising