MODTURNS
The MODTURNS function carries out a modulo division and determines the signed integral component (modulo periods, modulo rotations).
Examples
MODTURNS (800.56, 360) = 2
MODTURNS (-400.56, 360) = -2
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 : LREAL
Inputs
VAR_INPUT
lr_Value : LREAL;
lr_Arg : LREAL;
END_VAR
Name | Type | Description |
---|---|---|
lr_Value | LREAL | Input value |
lr_Arg | LREAL | Modulo range |
Requirements
Development environment | Target system type | PLC libraries to include |
---|---|---|
TwinCAT v3.0.0 | PC or CX (x86) | Tc2_Math |