The edge sensor for the CNC lathe is used for the position detection of the byte edge. When it applies the edge to the contact and pushes, on→OFF touch signal whose repeatability is good is output by CNC and PC, edge position is automatically written in. Because of this, former trial it shaves, it is not necessary to repeat the process which is called measurement, calculation and the input to NC, the skill of tool set becomes unnecessary, there is no worry which damages the machine with set mistake. In addition, breaking inspection of the byte and the revision of the abrasion loss is possible. Productivity improves machine tool operating time with rise. The sudden blade tool breaking which is in the midst of cutting work programming is inspected, continuation of processing is discontinued. By the fact that, the trouble which such as nighttime automated system operation of machining is in operation is left in minimum, it increases operating time, productivity improves. Inferior goods trouble such as occurrence is prevented. The edge of the tool just is made to contact the sensor, to brief to verify tool length and the numerical value of diameter, the tool revision quantity at the time of program the inferior goods occurrence with automatic operation throwing and input mistake is prevented beforehand. It can maintain high process precision. The process error due to tool wear and thermal error is measured, the NC order data is revised. Dynamic positioning accuracy improves substantially, the process precision where the machine tool is high is made to maintain usual.