ANY_TO_BOOL

Operator - Converts the input into boolean value.

Inputs

IN : ANY  Input value

Outputs

Q : BOOL  Value converted to boolean

Remarks

For DINT, REAL and TIME input data types, the result is FALSE if the input is 0. The result is TRUE in all other cases. For STRING inputs, the output is TRUE if the input string is not empty, and FALSE if the string is empty. In LD language, the conversion is executed only if the input rung (EN) is TRUE. The output rung is the result of the conversion. In IL Language, the ANY_TO_BOOL function converts the current result.

ST Language

Q := ANY_TO_BOOL (IN);

FBD Language

Any_To_BoolFbd.gif (1267 octets)

LD Language

(* The conversion is executed only if EN is TRUE *)
(* The output rung is the result of the conversion *)
(* The output rung is FALSE if the EN is FALSE *)
Any_To_BoolLd.gif (1465 octets)

IL Language:

Op1: LD  IN
     ANY_TO_BOOL
     ST  Q

See also

ANY_TO_SINT   ANY_TO_INT   ANY_TO_DINT   ANY_TO_LINT   ANY_TO_REAL   ANY_TO_LREAL   ANY_TO_TIME   ANY_TO_STRING