Trunc, L-force | plc designer – Lenze PLC Designer PLC Designer (R3-1) User Manual

Page 1073

Advertising
background image

L-force | PLC Designer

Programming Reference

DMS 4.1 EN 03/2011 TD29

1071

Examples in IL:

(* Result is TRUE *)

(* Result is 0 *)

(* Result is T#117ms *)

(* Result is 244 *)

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 *)

bv :=STRING:TO_BYTE('500');

(* Result is 244 *)

Examples in FBD:

(* Result is TRUE *)

(* Result is 0 *)

(* Result is T#127ms *)

(* Result is 244 *)

TRUNC
IEC Operator: Converting from REAL to DINT. The whole number portion of the value
will be used.

Note: In »PLC Designer« V2.3 the TRUNC operator converts from REAL to INT. For this
reason when importing a V2.3 project TRUNC automatically will be replaced by
TRUNC_INT.

When you perform a type conversion from a larger to a smaller type, you risk losing
some information.

Advertising