Skip to main content

TRUNC

Truncates Value and stores the result in Result.

Ladder Representation

TRUNC block

Block Structure

Variable TypeNameData TypeDescription
VAR_INPUTENBOOLBlock enabling.
VAR_INPUTValueREALReference variable for the operation.
VAR_OUTPUTDoneBOOLEnd of operation.
VAR_OUTPUTResultREALVariable 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

EquipmentVersion
PLC3002.10 or later.
SCA062.00 or later.

Execution Flowchart

TRUNC execution flowchart

Examples

TRUNC ladder example 1

This example truncates VALUE and stores the final result in RESULT. Decimal values are discarded. The block completes successfully and activates Done.