A device for exchanging data, such as a position or an identification, between a tool and a tool receiving structure. The device includes: an elongated track of sensors arranged in the receiving structure; and at least one sensor activating element arranged on the tool. The invention further relates to a method for exchanging data between a tool and a tool receiving structure, including: providing a device for exchanging data; activating at least one sensor activating element; and checking the track of sensors for activation of a sensor.