99 to one output of the microcomputer 81 via a line 100 connected to an additional output of microcomputer 81 the counter 97 is resettable to 34 0 34 the microcomputer 81 processes the pulses received from the pulse generator 78 and from the sensor 86 in accordance with its present program in a manner known in itself in addition it takes up the values depending on the rotational position of the potentiometer 54 which simulate the particular set stitch length of course the stitch length to be executed may be entered in the microcomputer 81 by hand via the input unit 84 rather than the potentiometer 54 in case of stitch length adjustments the sensor 86 consisting of a light emitter and light receiver is attached to the housing 1 of the sewing machine at a distance l fig3 before the path of needle 5 the sensor 86 cooperates with a reflecting foil 101 glued onto the stitch plate 10 of the sewing machine a light beam emanating from the light emitter of sensor 86 falls onto a scanning point a and in the absence of a workpiece w it is reflected by foil 101 onto the receiver of sensor 86 as soon as in fabric transport an edge 102 of the workpiece w e g of a collar moves over the scanning point a the workpiece w interrrupts the reflection of the light beam and sensor 86 sends a switching pulse via line 85 also see fig2 to.