SIS function blocks > SIS Math Blocks > Logic Solver Calculation function block > Expressions in DeltaV SIS Software > Functions in Logic Solver Expressions

TRUNC function

Floor function. TRUNC (x) returns a floating point value representing the largest integer that is less than or equal to x. That is, TRUNC rounds x to the next lowest integer value.

Syntax:

'external reference' := TRUNC(Real value);

Example:

VAR
   T63; T64; T17; T18; (* Temporary values *)
END_VAR;
T63 := .7;
T64 := 15.403;
T17 := TRUNC(T63);
T18 := TRUNC(T64);

The above example shows T63 set to the value of .7 and T64 set to the value of 15.403. T17 is set to the result of TRUNC(T63), which is 0 and T18 is set to the result of TRUNC(T64), which is 15.