MODABS

MODABS 1:

The MODABS function performs a modulo division and determines the unsigned modulo value within the modulo range.

Examples

MODABS(400.56, 360) = 40.56

MODABS(-400.56, 360) = 319.44

Similar functions: MOD, LMOD

MODABS 2:

The MODABS function can be used to calculate the modulo set position of an NC axis from its absolute set position.

ModuloSetPosition := MODABS( NcToPlc.fPosSoll, 360 );

FUNCTION MODABS : LREAL

MODABS 3: Inputs

VAR_INPUT
    lr_val : LREAL;
    lr_mod : LREAL;
END_VAR

Name

Type

Description

lr_val

LREAL

Input value

lr_mod

LREAL

Modulo range

MODABS 4:

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Math