Electronic device, particularly a transmitter for measuring a process measured variable, wherein the electronic device can be operated by a magnetic body, wherein the electronic device has an operating mode "with magnet" and a second operating mode "without magnet", wherein the electronic device comprises: a housing, which has at least one chamber in the interior of said housing; a magnetic body guide designed to hold and guide the magnetic body, wherein the magnetic body guide enables the positioning of a magnetic body, which has been received, in at least two defined magnetic body positions (a, b) in relation to the housing; a control and evaluation circuit, which is arranged in the chamber, with a first Hall effect sensor designed to capture at least one component of a first local magnetic field at the place of the first Hall effect sensor and to provide a first signal which depends on the local magnetic field measured at the first place, wherein the first Hall effect sensor has a first defined position in relation to the housing, and a second Hall effect sensor designed to capture at least one component of a second local magnetic field at the place of the second Hall effect sensor and to provide a second signal which depends on the local magnetic field measured at the second place, wherein the second Hall effect sensor has a second defined position in relation to the housing; wherein, during commissioning, the control circuit is suitable for determining whether a magnetic body is present in the magnetic body guide using the first signal (S 1) or a first digital state variable (Z 1) derived therefrom, and using a second signal (S 2) or a second digital state variable (Z 2) derived therefrom, wherein, if there is a magnetic body present, the device goes to the "with magnet" operating mode, wherein the control circuit uses one of the signals or both of the signals (S 1, S 2) or a digital state variable or both digital state variables (Z 1, Z 2) to determine whether the magnetic body is in the first defined magnetic body position or has been displaced from this position, particularly by at least a reference value, in order to recognize control commands, and wherein, if a magnetic body is not present, the device goes to the "without magnet" operating mode in which signals (S 1, S 2) of the Hall effect sensors are no longer evaluated. a housing, which has at least one chamber in the interior of said housing; a magnetic body guide designed to hold and guide the magnetic body, wherein the magnetic body guide enables the positioning of a magnetic body, which has been received, in at least two defined magnetic body positions (a, b) in relation to the housing; a control and evaluation circuit, which is arranged in the chamber, with a first Hall effect sensor designed to capture at least one component of a first local magnetic field at the place of the first Hall effect sensor and to provide a first signal which depends on the local magnetic field measured at the first place, wherein the first Hall effect sensor has a first defined position in relation to the housing, and a second Hall effect sensor designed to capture at least one component of a second local magnetic field at the place of the second Hall effect sensor and to provide a second signal which depends on the local magnetic field measured at the second place, wherein the second Hall effect sensor has a second defined position in relation to the housing; wherein, during commissioning, the control circuit is suitable for determining whether a magnetic body is present in the magnetic body guide using the first signal (S 1) or a first digital state variable (Z 1) derived therefrom, and using a second signal (S 2) or a second digital state variable (Z 2) derived therefrom, wherein, if there is a magnetic body present, the device goes to the "with magnet" operating mode, wherein the control circuit uses one of the signals or both of the signals (S 1, S 2) or a digital state variable or both digital state variables (Z 1, Z 2) to determine whether the magnetic body is in the first defined magnetic body position or has been displaced from this position, particularly by at least a reference value, in order to recognize control commands, and wherein, if a magnetic body is not present, the device goes to the "without magnet" operating mode in which signals (S 1, S 2) of the Hall effect sensors are no longer evaluated.