REAL_TO_BOOL
The REAL_TO_BOOL block converts a REAL value to BOOL.
Ladder Representation
Block Structure
| Variable Type | Name | Data Type | Description |
|---|---|---|---|
| VAR_INPUT | EN | BOOL | Block enable. |
| VAR_INPUT | Value | REAL | REAL value. |
| VAR_OUTPUT | ENO | BOOL | End of operation. |
| VAR_OUTPUT | Result | BOOL | BOOL 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

Examples
- Ladder
- Structured Text
The Ladder examples convert VALUE from REAL to BOOL, store the final value in RESULT, and activate ENO when the block finishes successfully.
The following Structured Text code applies the same logic shown in the Ladder example.
Structured Text
VAR
VALUE : REAL := 0.008;
RESULT : BOOL;
END_VAR
RESULT := FB_REAL_TO_BOOL(EN:=DI1, Value:=VALUE, ENO=>DO1);