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

Page 496

Advertising
background image

L-force | PLC Designer

IEC Operators and additional norm extending functions

494

DMS 3.2 EN 02/2011 TD29



9.9.8

STRING_TO Conversions

Converting from the variable type STRING to a different type:

The operand from the STRING type variable must contain a value that is valid in the
target variable type, otherwise the result will be 0.

Examples in IL:

LD 'TRUE'
STRING_TO_BOOL
ST b

(* Result is TRUE *)

LD 'abc34'
STRING_TO_WORD
ST w

(* Result is 0 *)

LD 't#127ms'
STRING_TO_TIME
ST t

(* Result is T#127ms *)


Examples in ST:

b :=STRING_TO_BOOL('TRUE');

(* Result is TRUE *)

w :=STRING_TO_WORD('abc34');

(* Result is 0 *)

t :=STRING_TO_TIME('T#127ms');

(* Result is T#127ms *)


Examples in FBD:

Advertising