a controller for controlling a wire electric discharge machine is configured to monitor the remaining lifetime of a wire electrode and calculates an electric discharge machining time , thereby determining the timing of replacement of the wire electrode , so that it can recognize the timing of interruption of electric discharge machining . consequently , a program operation can be suspended and the wire electrode can be cut and automatically replaced at that timing . after the replacement of the wire electrode , moreover , the wire electrode can be connected and the program operation can be restarted .