Macro overview

The macro is intended for use on 3-axis machining centers to perform a keyway.

The aim is to greatly simplify the programming side since in order to execute a simple figure like that of a stick the lines of code to be written can become several!

In fact, it is necessary to calculate all the positions of the cutter to perform a first roughing which must then be repeated several times until reaching the desired depth, finally the finishing pass must be performed.

All this can be replaced instead with a single line of code!

Description of the parameters

Here is an example of the line of code to call the macro.


  • P = program number where the macro resides in memory
  • A = Performing roughing 1 = yes 0 = no
  • B = Finishing 1 = yes 0 = no
  • C = cutter diameter
  • D = keyway width
  • E= depth of pass
  • H= oversize
  • R = Start plan
  • X = position X initial center of the key
  • Y = position Y initial center of the key
  • I = position X final center of the key
  • J = position Y final center of the key
  • Z = key depth
  • F = feedrate

Cycle description

When called, the macro performs an internal check of the parameters that are passed, in the event of errors or forgetfulness an alarm will be generated.

In the event that the control is passed, the macro will bring the cutter to the beginning of the processing and will generate a roughing profile of the key which is repeated until the required depth is reached.

Subsequently, the finishing profile is also generated, which brings the key measurement to the theoretical measurement specified through the parameters.