the advantages of the various embodiments lie especially in the fact that setting an incorrect reference position is prevented . furthermore the various embodiments make possible the use of an anti - trap system even during determination of the reference position . the method according to various embodiments can execute automatically . no user activity is required for executing the method , in particular a button does not need to be pressed . for example the method can be activated automatically within the framework of a diagnostic task in automotive plants and motor vehicle workshops . a method in accordance with various embodiments can also be executed in conjunction with learning processes of the force curves of window lift systems and sliding roof systems , with these learning processes able to be carried out in the plant but also as part of a subsequent visit by the motor vehicle to a workshop . to cater for any slight tolerances which may arise , in the claimed method a matching of the counts of the position counter is recognized as being present if the difference between the counts compared to one another is less than a predetermined threshold value . to increase the security of a correct fixing of the reference position the locking part is advantageously moved a number of times in the direction of its closed state and the associated counter state of the position counter on reaching the respective stop is evaluated . this repeated movement of the locking part in the direction of its closed state can advantageously be repeated a number of times with changed parameters of the anti - trap system especially with anti - trapping which increases from closing process to closing process . this means that the probability of the occurrence of injuries to a person placing their hand in the path of the locking part is reduced . if in the claimed method , as part of the check as to whether the counter states of the position counter compared to one another match , no match is determined , then this method can be ended or automatically carried out once again or carried out once again with changed parameters of the anti - trap mechanism . fig1 shows the block diagram of a device for determining a reference position of a locking part of a motor vehicle moved by an electric motor . in the exemplary embodiment shown this locking part involves the window pane provided in the driver &# 39 ; s door of the motor vehicle . the raising and lowering of this window pane is undertaken by means of an electric motor which has a stator and a rotor . the rotor contains a rotor shaft 1 to which a generator wheel 1 a is fixed non - rotationally . the generator wheel 1 a has coding sectors or poles . when the rotor shaft with the generator wheel attached to it is turned impulse signals are detected by a sensor array 2 and fed to a control unit 3 which is formed by a microcomputer . the control unit 3 changes the position count stored in a position counter 4 each time an impulse is received so that the count of the position counter 4 always exactly describes the instantaneous position of the window pane . the control unit 3 is connected via a bus 7 to one or more further control units of the motor vehicle . furthermore the device shown features a first memory 5 . this memory 5 is a non - volatile memory , for example an eeprom . data is stored in this first memory 5 which corresponds to a force - travel reference curve . this data has already been determined during the manufacturing of the motor vehicle in the plant and is stored in non - volatile form in the first memory 5 . this data is individually assigned to the respective window lift drive and contains information about the force which must be applied by the motor at a particular window position to close the respective window pane . furthermore the device shown in the figure has a second memory 6 . this can involve a volatile memory , for example a ram or the main memory of the control unit 3 realized as a microcomputer . stored in the second memory 6 is a force - travel actual value curve determined during motor vehicle operation for each opening and closing of the window pane . the control unit 3 uses the force - travel reference curve stored in the first memory 5 and the force - travel actual value curve stored in the second memory 6 to check whether counter errors have occurred during operation in relation to the counting of the pulses output by the sensor array 2 , which have led to an incorrect count state of the position counter 4 . if such a count error is detected it is compensated for by the control unit 3 . as an alternative , actual values determined can also be compared with the stored reference curve in order to establish whether count errors have occurred . to determine the said force - travel reference curve a normalization of the system is first required , i . e . a determination of a reference position of the window pane moved by the electric motor . this reference position at which the counter state of the position counter 4 is preferably set to the value 0 , is the closed state of the window pane in the exemplary embodiment shown . the starting point for the determination of this reference position is for example the open state of the window pane and this will be explained in greater detail below with reference to fig2 . starting from the open state of the window pane , under control by the control unit 3 in a step s 1 the window pane is moved in the direction of its closed state until such time as it reaches a first stop position . during this closing movement of the window pane the counter state of the position counter 4 is reduced depending on the position impulses provided by the sensor array 2 . if the first stop position is reached the control unit 3 detects in a step s 2 the counter state of the position counter 4 describing the first stop position and stores this counter state in a buffer . this buffering of the counter state describing the first stop position is undertaken for example in a main memory of control unit 3 . after this buffering of the counter state describing the first stop position , in a step s 3 , the control unit 3 controls a movement of the locking part in the direction of its opened state . this movement can be undertaken until the opened state is reached . during this opening movement of the window pane the counter state of the position counter 4 is increased depending on the position impulses provided by the sensor array 2 . then , in a step s 4 , the control unit 3 controls a renewed movement of the window pane in the direction of its closed state until such time as a second stop position is reached . during this renewed closing movement of the window pane the counter state of the position counter 4 is again reduced depending on the position impulses provided by the sensor array 2 . if the second stop position is reached , the control unit 3 detects in a step s 5 the counter state of the position counter 4 describing the second stop position . then the control unit 3 checks in a step s 6 whether the counter state belonging to the first stop position matches the corresponding counter state of the second stop position or not . within the framework of this checking a small tolerance is preferably permitted , which is expressed by a predetermined threshold value . if the control unit 3 detects that the difference between the two counter states is smaller than the predetermined threshold value , it then recognizes a match between the two counter states and in accordance with a subsequent step s 7 it fixes the first stop position as a reference position . this reference position is assigned a new counter state 0 by the control unit 3 . this new counter state 0 is also transferred as a reference counter state into position counter 4 and serves as an initial counter state for all subsequent window movements . the method then moves to step s 8 which represents the end of the method . if the control unit 3 detects in step s 6 however that the counter state corresponding to the first stop position does not match the counter state corresponding to the second stop position , a branch is made directly to step s 8 which represents the end of the method . the method described above has the following effects on the determination of the reference position of a locking part of a motor vehicle moved by an electric motor : if in step s 1 the locking part is moved into its closed state without encountering an obstacle beforehand , then the first stop position corresponds to the closed state of the locking part . if the locking card is then moved after execution of steps s 2 and s 3 in step s 4 anew into its closed state , without encountering an obstacle beforehand , then the result of the check conducted in step s 6 is that the two stop positions match and the control unit 3 fixes the first stop position which matches the second stop position in the correct manner as the reference position . if on the other hand an obstacle , for example the hand of a mechanic or any other undesired obstacle , gets in the way of the closing window pane , then the first stop position does not involve the desired closed state of the locking part . this undesired obstacle can be pulled out of the path of the locking part during or after the execution of step s 3 . a result of this is that in step s 4 the locking part arrives at a second stop position which corresponds to the desired closed state of locking part . in this case the second stop position is assigned a counter state other than that assigned to the first stop position . this is detected by the control unit 3 in step s 6 , so that the method branches directly from step s 6 to step s 8 , i . e . to the end of the method . the result advantageously achieved by this is that no incorrect position is fixed as the reference position . to avoid injury if the hand of the mechanic becomes trapped or to avoid damage to the mechanics of the motor vehicle if any other obstacle becomes trapped , in an advantageous manner the movement of the locking part in the direction of its closed state in steps s 1 and / or s 4 can be undertaken with an anti - trap facility controlled by the control unit 3 whereby for a movement of the locking part with a closing force movement no motor blocking must occur in the event of coming up against a stop furthermore in accordance with an embodiment , the closing and opening processes of the window as well as the subsequent checking by the control unit can be undertaken several times in succession in order to further reduce the probability of the reference position not being correctly fixed . with this multiple execution of the closing and opening processes of the window the anti - trapping can be increased from step to step up to a desired final value . in accordance with the exemplary embodiment described above , in the event of the two counter states not matching in step s 6 , a branch has been made to step s 8 in order to end the method . in accordance with another exemplary embodiment not depicted in the figures , the control unit 3 in the event of the two counter states not matching , can also initiate an automatic restart of the method . this can if necessary be undertaken with changed parameters of the anti - trap mechanism .