PURPOSE: To change tools without reforming an NC device by recognizing an advance direction of a magazine corresponding to the sequence of signals of switches A and B, and detecting a containing pot number based on a value of a counter for each switch signal by the containing pots moving in order.
CONSTITUTION: A signal for an origin point is outputted from an origin point switch 6 by an origin point pot 11, a pot number for the origin point 11 is determined, and the value is set at a counter 81. When a magazine 2 is moved by instruction by an NC, the value of the counter 81 is changed by a switch A signal and a switch B signal, and the value is set as a pot number for a containing pot 1. By detecting this pot number, and reading a tool number, the pot numbers for all the containing pots 1 fixed at the magazine 2, and the tool numbers can be displayed in a display separately from a sequence part or program of the NC.