profiling function is switched on this function lowers the cutting head 7 causing the distance from a reference object 40 in place of the workpiece 5 to be a set height upon completion of the profiling operation the z axis position and profile sensor 9 detection signal at that time are stored in step 106 hereafter the sensor signal may be used as the criterion i e reference signals and the z axis position used as the sensor checking position then the profiling function is switched off in step 107 and the z axis is raised again in step 108 as in step 103 then in step 109 the x and y axes are moved to the position stored in step 102 in step 110 the z axis is similarly moved to the position stored in step 102 this returns the machine to the original position after storing the z axis position and criterion for sensor check there is no problem in the continuation of cutting because the machine has returned to the original position the sensor installation height is not changed during the automatic operation cutting therefore once the checking criteria have been stored the sensor check can be performed automatically when a profiling fault occurs during cutting an embodiment in which cutting is stopped when a fault.