A method of machining by spark erosion on a wire spark-erosion machine by means of a spark-erosion wire packaged on a spool including an RFID tag carrying identification data of said wire and associated with an onboard accelerometer on the RFID tag or on the spool, the method including:
- scrutinizing and storing, in the RFID tag, signals produced by the onboard accelerometer on the RFID tag or on the spool,
- computing, in the RFID tag, a number of turns effected by the spool about its axis as a function of acceleration signals received from the onboard accelerometer, and computing a quantity of wire remaining on the spool.