The magnetic field is only produced once a device is switched on and current flows. The higher the current, the greater the strength of the magnetic field.

Please, see my attached file.