A magnetic revolution counter or displacement counter for the self-detection of error states in the determination of revolution numbers or displacement numbers n ascertainable in a predefinable manner by way of this revolution counter or displacement counter, generated by a rotating magnetic element, or displacement number, generated by a number n of magnetic poles of a rotating magnet wheel that can be moved past, or by a linear magnetic scale that can be moved past, comprising a sensor, which includes magnetic domain wall conductors composed of open spirals (20; 20a, 20b) or closed, multiply-wound loops, which are formed by a GMR layer stack or a soft magnetic layer comprising locally present TMR layer stacks and in which magnetic 180° domain walls can be introduced, and the presence or absence thereof can be determined by measuring the electrical resistance of predefinable spiral or loop sections, by way of contacts (70, 80; 91, 93 95, 90, 92, 94 or 70, 80; 91, 93, 95, 97 or 71, 81; 91, 93, 95, 97-72, 82; 99, 101, 103, 105, 107 or 71, 81; 91, 93-72, 82; 95, 97, 99 or 71, 81; 91 to 74, 84; 95) provided on the domain wall conductors, wherein - a first memory, a second memory and a processing unit are provided, - a predefinable bijective magnetization pattern of domain walls and/or domain wall gaps is written into the domain wall conductors, - said contacts, together with associated domain wall conductor sections captured thereby, are interconnected to form Wheatstone bridges or half bridges that are separate, but can be read out together, wherein the resistance ratios ascertained by the Wheatstone bridges or half bridges are all stored as signal levels in the form of signal level sequences in the first memory in tabular form, wherein the signal level sequences stored in the first memory can be continuously compared to tabular target value patterns (10a, 10b, 10c and 10d) of the signal level sequences stored in the second memory for each permissible revolution i (0 ≤ i ≤ n) for the ascertainment of the present revolution number or displacement number, and - a third memory is provided, in which tabular error target value patterns (12a, 12b, 12c, 12d) for all possible, not intended changes in the written-in magnetization pattern and the deviations of signal level sequences, caused thereby, from regular signal level sequences stored in the second memory are stored, which, however, can still be bijectively assigned to a revolution number or a shift step, and - a continuous comparison can be carried out by way of the processing unit between the ascertained signal level sequences stored in the first memory and the signal level sequences stored in the second memory and the third memory, and - the signal level can be output during an entire or a half revolution of the rotating element, or a shift step of the rotating magnet wheel, or of the linear magnetic scale that can be moved past, as a bijective revolution value or shift value, or directly as an uncorrectable error. - a first memory, a second memory and a processing unit are provided, - a predefinable bijective magnetization pattern of domain walls and/or domain wall gaps is written into the domain wall conductors, - said contacts, together with associated domain wall conductor sections captured thereby, are interconnected to form Wheatstone bridges or half bridges that are separate, but can be read out together, wherein the resistance ratios ascertained by the Wheatstone bridges or half bridges are all stored as signal levels in the form of signal level sequences in the first memory in tabular form, wherein the signal level sequences stored in the first memory can be continuously compared to tabular target value patterns (10a, 10b, 10c and 10d) of the signal level sequences stored in the second memory for each permissible revolution i (0 ≤ i ≤ n) for the ascertainment of the present revolution number or displacement number, and - a third memory is provided, in which tabular error target value patterns (12a, 12b, 12c, 12d) for all possible, not intended changes in the written-in magnetization pattern and the deviations of signal level sequences, caused thereby, from regular signal level sequences stored in the second memory are stored, which, however, can still be bijectively assigned to a revolution number or a shift step, and - a continuous comparison can be carried out by way of the processing unit between the ascertained signal level sequences stored in the first memory and the signal level sequences stored in the second memory and the third memory, and - the signal level can be output during an entire or a half revolution of the rotating element, or a shift step of the rotating magnet wheel, or of the linear magnetic scale that can be moved past, as a bijective revolution value or shift value, or directly as an uncorrectable error.