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.

Modulo Movements 1:

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.

Modulo Movements 2:

Restrictions for modulo movements. Please note:

  • No radius compensation may be active for the modulo axis.
  • No zero offset shift may be active for the modulo axis.
  • During relative programming (G91) the modulo command is not evaluated, so that the axis referred to in square brackets is treated as if the MOD command had not been given.

Modulo factor

The modulo factor is constant, and is 360.