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

BOOL_TO Conversions

Definition

IEC operator for conversions from type BOOL to any other type.

Syntax

BOOL_TO_<data type>

Conversion Results

The conversion results for number types and for string types depend on the state of the operand:

Operand State

Result for Number Types

Result for String Types

TRUE

1

TRUE

FALSE

0

FALSE

Examples in ST

Examples in ST with conversion results:

Example

Result

i:=BOOL_TO_INT(TRUE);

1

str:=BOOL_TO_STRING(TRUE);

'TRUE'

t:=BOOL_TO_TIME(TRUE);

T#1ms

tof:=BOOL_TO_TOD(TRUE);

TOD#00:00:00.001

dat:=BOOL_TO_DATE(FALSE);

D#1970

dandt:=BOOL_TO_DT(TRUE);

DT#1970-01-01-00:00:01

Examples in IL

Examples in IL with conversion results:

Example

Result

LD                TRUE
BOOL_TO_INT
ST                i

1

LD                TRUE
BOOL_TO_STRI...
ST                str

'TRUE'

LD                TRUE
BOOL_TO_TIME
ST                t

T#1ms

LD                TRUE
BOOL_TO_TOD
ST                tof

TOD#00:00:00.001

LD                FALSE
BOOL_TO_DATE
ST                dandt

D#1970-01-01

LD                TRUE
BOOL_TO_DT
ST                dandt

DT#1970-01-01-00:00:01

Examples in FBD

Examples in FBD with conversion results:

Example

Result

G-SE-0024432.1.gif-high.gif

 

 

1

G-SE-0024433.1.gif-high.gif

 

 

'TRUE'

G-SE-0024434.1.gif-high.gif

 

 

T#1ms

G-SE-0024435.1.gif-high.gif

 

 

TOD#00:00:00.001

G-SE-0024436.1.gif-high.gif

 

 

D#1970-01-01

G-SE-0024431.1.gif-high.gif

 

 

DT#1970-01-01-00:00:01