abs(Function)

Top  Previous  Next

Architecture:

X32 / NX32 / NX32L

Device support:

ALL

Firmware version:

3.10 / 1.00.00


This function will calculate the absolute value of a DINT.

 

Input:

V : DINT

Value to convert.

 

Returns: DINT

The absolute value of V.

 

Declaration:

FUNCTION abs : DINT;
VAR_INPUT
v : DINT;
END_VAR;

 

 

Example:

INCLUDE rtcu.inc
 
PROGRAM test;
 
DebugFmt(message := " abs( -123) = \4", v4 := abs( v:= -123));
 
END_PROGRAM;