At first, the zero point are measured with the cycles "measuring Edge", "align Edge" and "rectangle spigot". The zero point is in the middle of the workpiece on the surface. The values measured are automatically entered in the zero offset, in the example G54. One pocket is milled and then automatically measured. On the basis of this measurement, the machining operation can, for example, be terminated resp. the pocket can be reworked using offset values. The measurement cycle “Measure pocket“ is called up within the program and determines the measured values of the milled pocket. If the measurement values are outside tolerance and the pocket can no longer be reworked, the program is stopped. If the pocket dimension is too small, the offset value is determined automatically and entered in in the tool wear value. The pocket is reworked using the new offset values. If, during the final measurement procedure, the values are within tolerance, the machining step is terminated and the workpiece is ready.