Block that performs the conversion of a REAL value into a BOOL value.
Ladder Representation
![]()
Block Structure
Variable Type |
Name |
Data Type |
Description |
VAR_INPUT |
EN |
BOOL |
Block enabling |
Value |
REAL |
Value in REAL |
|
VAR_OUTPUT |
ENO |
BOOL |
End of operation |
Result |
BOOL |
Value in BOOL |
Operation
When this block has a TRUE value in EN, it interprets the Value value as REAL and converts it into BOOL, storing in Result.
When EN has FALSE value, Result remains unchanged.
The ENO value forwards to the next Ladder block the EN value after the operation is completed.
Block Flowchart

Example in Ladder




The examples above perform the conversion of VALUE variable, in REAL, into a BOOL value storing the final result in RESULT. The block ends with success and ENO output is activated. Notice in the last example that the values very close to the machine epsilon may result in an interpretation of the FALSE value.
Example in ST
The example below displays the instructions for applying the example above in the ST language.
VAR VALUE : REAL := 0.008; RESULT : BOOL; END_VAR
RESULT := FB_REAL_TO_BOOL(EN:=DI1, Value:=VALUE, ENO=>DO1);
|
|---|