Modulo Movements
from TwinCAT V2.7 Build 451
Command | MOD[<axis and target modulo position>] |
Cancellation | End of block |
Parameter 1 | Axis for modulo operation |
Parameter 2 | Arithmetic sign for the direction of rotation (optional) |
Parameter 3 | Modulo position |
The modulo position is programmed in the same way as normal positioning.
The MOD command is effective for specific blocks, and must be explicitly programmed for every axis that is selected for modulo operation. The modulo position's arithmetic sign specifies the direction of rotation.
- Positive sign: The axis moves in the 'greater' direction
- Negative sign: The axis moves in the 'smaller' direction
- Exception: The axis cannot move to modulo -0, since 0 has no sign
Sample 1:
N10 G90
N20 G01 MOD[X200] Y30 F600
N30 G01 X200
N20 specifies a move in a positive direction for X to modulo position 200. Y is taken to absolute position 30. In block N30, X is moved to absolute (in other words not modulo) position 200.
Modulo movements of more than 360 degrees
The MOD command also allows movements of more than 360 degrees to be made.
Modulo position = number of necessary rotations * 360 + modulo position
Sample 2:
N10 G90
N20 G01 X3610 F6000
N30 R1=360
N40 G01 MOD[X=R1+20]
In this example, the X axis moves 370 degrees to modulo position 20.
![]() | Restrictions for modulo movements. Please note:
|
Modulo factor
The modulo factor is constant, and is 360.