EcoStruxure Machine Expert version 1.1 does not support the M258, LMC058 and LMC078 controllers.

TO_<xxx> Conversions

Definition

Conversion of variables from one type to another type. The input type must not be specified explicitly (overloaded conversion).

Also refer to the description of type conversion functions.

Syntax

TO_<data type>

Example in ST

Conversion from a variable of data type REAL to INT:

VAR
   iVar: INT;
   bVar: BOOL;
   strVar: STRING;
            rVar: REAL;
END_VAR

wVar:=TO_WORD('123')     (* result is 123 *)
bVar:=TO_BOOL(1);        (* result is TRUE *)
strVar:=TO_STRING(342);  (* result is '342' *)
iVar_=TO_INT(4.22);      (* result is 4 *)