Direct drive for a rotary machine, in particular for a container handling machine, comprising: a) a stationary machine part and a machine part which rotates about a vertical machine axis, b) an anti-friction bearing which is arranged between the machine parts (1, 2), c) the anti-friction bearing consists of an outer bearing ring, an inner bearing ring and a multiplicity of rolling bodies which roll between the said bearing rings (4, 5), d) the rotating machine part is connected rotatably to the stationary machine part via the anti-friction bearing and can be driven by way of a torque motor, e) a multiplicity of magnets are provided circumferentially on the rotating machine part, f) a stator which consists of a multiplicity of electric coils (9, 10, 11) is arranged on the stationary machine part, g) the rotating machine part can be set into a defined rotational movement by way of an electromagnetic field, which is generated upon energization of the stator, in interaction with the magnets, h) the stator is configured as a full ring of 360° which covers all the magnets on the rotating machine part without a gap, i) the stator is composed of a plurality of stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) which adjoin one another and are connected to one another by way of an electric series circuit, and of a plurality of stop elements (14.1, 14.2, 14.3, 14.4, 14.5) which are arranged between the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) for fixing the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) in the circumferential and radial direction, j) the individual stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) consisting in each case of a ferrous metallic yoke and of a plurality of toothed metal sheets which are stacked above one another on the upper and lower side of the said yoke and around the teeth of which copper windings for forming the individual electric coils (9, 10, 11) are wound, k) the stop elements (14.1, 14.2, 14.3, 14.4, 14.5) which are arranged between the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) preferably having the form of circular ring segments which are in bearing contact with the yokes of extended configuration and; with the radial side faces of the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5), characterized l) in that one of the stop elements (14.1, 14.2, 14.3, 14.4, 14.5) which are arranged between the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) is at the same time a holder for a scanning sensor which forms a measuring system for determining the position of the rotating machine part with an incremental or absolute, magnetic or inductive angular division on the rotating machine part. a) a stationary machine part and a machine part which rotates about a vertical machine axis, b) an anti-friction bearing which is arranged between the machine parts (1, 2), c) the anti-friction bearing consists of an outer bearing ring, an inner bearing ring and a multiplicity of rolling bodies which roll between the said bearing rings (4, 5), d) the rotating machine part is connected rotatably to the stationary machine part via the anti-friction bearing and can be driven by way of a torque motor, e) a multiplicity of magnets are provided circumferentially on the rotating machine part, f) a stator which consists of a multiplicity of electric coils (9, 10, 11) is arranged on the stationary machine part, g) the rotating machine part can be set into a defined rotational movement by way of an electromagnetic field, which is generated upon energization of the stator, in interaction with the magnets, h) the stator is configured as a full ring of 360° which covers all the magnets on the rotating machine part without a gap, i) the stator is composed of a plurality of stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) which adjoin one another and are connected to one another by way of an electric series circuit, and of a plurality of stop elements (14.1, 14.2, 14.3, 14.4, 14.5) which are arranged between the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) for fixing the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) in the circumferential and radial direction, j) the individual stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) consisting in each case of a ferrous metallic yoke and of a plurality of toothed metal sheets which are stacked above one another on the upper and lower side of the said yoke and around the teeth of which copper windings for forming the individual electric coils (9, 10, 11) are wound, k) the stop elements (14.1, 14.2, 14.3, 14.4, 14.5) which are arranged between the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) preferably having the form of circular ring segments which are in bearing contact with the yokes of extended configuration and; with the radial side faces of the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5), characterized l) in that one of the stop elements (14.1, 14.2, 14.3, 14.4, 14.5) which are arranged between the stator ring segments (13.1, 13.2, 13.3, 13.4, 13.5) is at the same time a holder for a scanning sensor which forms a measuring system for determining the position of the rotating machine part with an incremental or absolute, magnetic or inductive angular division on the rotating machine part.