For determining switching signal 18, piston 4 is moved to a desired position C. At this position C, sensor elements 10, 12 feed an unambiguous group of signal values to evaluation unit 14. A key 28 is provided for initiating a learning mode so that switching signal 18 for position C of piston 4 can be electronically stored in evaluation unit 14. For this purpose, evaluation unit 14 includes a memory. Displays 36, 36' are provided so that an operator can observe the learning process. This optical response can be used to confirm that the learning process was successful.