TRUNC
Truncates Value and stores the result in Result.
Ladder Representation
Block Structure
| Variable Type | Name | Data Type | Description |
|---|---|---|---|
| VAR_INPUT | EN | BOOL | Block enabling. |
| VAR_INPUT | Value | REAL | Reference variable for the operation. |
| VAR_OUTPUT | Done | BOOL | End of operation. |
| VAR_OUTPUT | Result | REAL | Variable that stores the operation result. |
Operation
When EN is TRUE, the block writes the truncated value of Value to Result.
If the operation completes without errors, Done is set. If an operation error occurs, Done remains FALSE and Result keeps its previous value.
When EN is FALSE, Result remains unchanged and Done remains FALSE.
Compatibility
| Equipment | Version |
|---|---|
| PLC300 | 2.10 or later. |
| SCA06 | 2.00 or later. |
Execution Flowchart

Examples
- Ladder Example
- Structured Text Example
This example truncates VALUE and stores the final result in RESULT. Decimal values are discarded. The block completes successfully and activates Done.
The following Structured Text code applies the same logic shown in the Ladder example.
Structured Text
VAR
VALUE : REAL := 56.5;
RESULT : REAL;
END_VAR
RESULT := FB_TRUNC(EN:=DI1, Value:=VALUE, Done=>DO1);