Method to detect or monitor the demagnetization of the permanent magnets of the generator of a wind turbine, the generator comprising: - a stator comprising stator windings, - a rotor comprising permanent magnets, wherein the permanent magnets and the stator windings facing each other in circumferential direction via an air-gap, wherein the rotation of the rotor in relation to the stator generates the generator output voltage (Vout) of the generator; the wind turbine further comprising: - a frequency converter to adapt the variable frequency of the generator output voltage (Vout) to the frequency of a power grid being connectable or connected to the output of the frequency converter, the method characterized by providing: in the frequency converter a voltage sensor being able to determine the generator output voltage (Vout); - circuit breakers to switch the electrical connections (P1, P2, P3, Vout) between the generator and the frequency converter, and - a temperature sensor to determine the temperature of the permanent magnets of the generator; further characterized by the steps: - disable an the AC/DC converter of the frequency converter, - switch on the electrical connections (P1, P2, P3, Vout) between the generator and the frequency converter, - determine the generator speed ( ω); - determine the generator output voltage (Vout) by the voltage sensor of the frequency converter, - determine the temperature of the permanent magnets of the generator by the temperature sensor, - calculate the magnetic flux (φ) of the generator depending on the generator speed ( ω) and the generator output voltage (Vout), - compensate the temperature dependence of the magnetic flux of the generator by calculating a resulting magnetic flux (φres) based on the magnetic flux (φ) and the determined termperature, - determine a demagnetization event by comparing the resulting magnetic flux (φres) with a predetermined flux (φref). - a stator comprising stator windings, - a rotor comprising permanent magnets, wherein the permanent magnets and the stator windings facing each other in circumferential direction via an air-gap, wherein the rotation of the rotor in relation to the stator generates the generator output voltage (Vout) of the generator; - a frequency converter to adapt the variable frequency of the generator output voltage (Vout) to the frequency of a power grid being connectable or connected to the output of the frequency converter, the method characterized by providing: in the frequency converter a voltage sensor being able to determine the generator output voltage (Vout); - circuit breakers to switch the electrical connections (P1, P2, P3, Vout) between the generator and the frequency converter, and - a temperature sensor to determine the temperature of the permanent magnets of the generator; further characterized by the steps: - disable an the AC/DC converter of the frequency converter, - switch on the electrical connections (P1, P2, P3, Vout) between the generator and the frequency converter, - determine the generator speed ( ω); - determine the generator output voltage (Vout) by the voltage sensor of the frequency converter, - determine the temperature of the permanent magnets of the generator by the temperature sensor, - calculate the magnetic flux (φ) of the generator depending on the generator speed ( ω) and the generator output voltage (Vout), - compensate the temperature dependence of the magnetic flux of the generator by calculating a resulting magnetic flux (φres) based on the magnetic flux (φ) and the determined termperature, - determine a demagnetization event by comparing the resulting magnetic flux (φres) with a predetermined flux (φref). - disable an the AC/DC converter of the frequency converter, - switch on the electrical connections (P1, P2, P3, Vout) between the generator and the frequency converter, - determine the generator speed ( ω); - determine the generator output voltage (Vout) by the voltage sensor of the frequency converter, - determine the temperature of the permanent magnets of the generator by the temperature sensor, - calculate the magnetic flux (φ) of the generator depending on the generator speed ( ω) and the generator output voltage (Vout), - compensate the temperature dependence of the magnetic flux of the generator by calculating a resulting magnetic flux (φres) based on the magnetic flux (φ) and the determined termperature, - determine a demagnetization event by comparing the resulting magnetic flux (φres) with a predetermined flux (φref).