MODTURNS

MODTURNS 1:

The MODTURNS function carries out a modulo division and determines the signed integral component (modulo periods, modulo rotations).

MODTURNS 2:

Value range of DINT

If the value of the result of MODTURNS lies outside of the value range of DINT, an undefined result will be delivered.

Examples

MODTURNS (800.56, 360) = 2

MODTURNS (-400.56, 360) = -2

MODTURNS 3:

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

ModuloSetTurns := MODTURNS ( NcToPlc.fPosSoll, 360 );

FUNCTION MODTURNS : DINT

MODTURNS 4: Inputs

VAR_INPUT
    lr_Value : LREAL;
    lr_Arg : LREAL;
END_VAR

Name

Type

Description

lr_Value

LREAL

Input value

lr_Arg

LREAL

Modulo range

MODTURNS 5:

Requirements

Development environment

Target system type

PLC libraries to include

TwinCAT v3.0.0

PC or CX (x86)

Tc2_Math