The size of the magnetic flux changes is as illustrated in FIG. 2, which shows the two Hall-voltages 22 and 24 of both sensor elements 8, 10 in dependence on the piston stroke. Stroke 6 of the piston from position A in the direction of position B is shown on the abscissa. The ordinate shows the output voltage U of the Hall-sensors. The two sensor signals 22, 24 define an unambiguous group of signal values 20 for each position of the piston that carries the permanent magnet. In the illustrated example, the group of signal values 20 is a signal value pair. For example, at piston position C the signals of the group of signal values 20 have different signal values than the signals of the group of signal values 20' at position D.