ABS

The IEC operator returns the absolute value of a number.

Permitted data types for the input and output variables and number constants: any numeric basic data type

Examples:

Result: nVar is 2.

ST:

nVar := ABS(-2);

FBD:

ABS 1: