Relatively simple uses of pneumatic cylinder 34 may require, for example, four switching signals 18. Two of the switching signals 18 are needed for end positions A and B. In addition to the end positions, two further switching signals 18 are needed for braking or decelerating piston 4 before it reaches its end positions. The two additional switching signals are taken in a direction towards a middle of the piston stroke at positions which are relatively close to the end positions. To display additional positions of piston 4, further switching signals 18 can be learned.