Skip to main content

REAL_TO_BOOL

The REAL_TO_BOOL block converts a REAL value to BOOL.

Ladder Representation

REAL_TO_BOOL Ladder representation

Block Structure

Variable TypeNameData TypeDescription
VAR_INPUTENBOOLBlock enable.
VAR_INPUTValueREALREAL value.
VAR_OUTPUTENOBOOLEnd of operation.
VAR_OUTPUTResultBOOLBOOL value.

Operation

When EN is TRUE, the block interprets Value as a REAL value, converts it to BOOL, and stores the result in Result.

When EN is FALSE, Result remains unchanged.

The ENO output passes the EN state to the next Ladder block after the operation is finished.

Machine Epsilon

Values very close to the machine epsilon can be interpreted as FALSE in the final result.

Execution Flowchart

REAL_TO_BOOL execution flowchart

Examples

The Ladder examples convert VALUE from REAL to BOOL, store the final value in RESULT, and activate ENO when the block finishes successfully.

REAL_TO_BOOL Ladder example

REAL_TO_BOOL Ladder example result

REAL_TO_BOOL additional Ladder example

REAL_TO_BOOL additional Ladder example