diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py index 6248529558fb2178a2ee7feb62ed175a376e144c..de3c520a68f2456cc4ff5831662e74f1f12d3b4d 100644 --- a/ohmpi/ohmpi.py +++ b/ohmpi/ohmpi.py @@ -784,6 +784,11 @@ class OhmPi(object): cmd_id : str, optional Unique command identifier """ + # check pwr is on, if not, let's turn it on + switch_power_off = False + if self._hw.pwr_state == 'off': + self._hw.pwr_state = 'on' + switch_power_off = True self._hw.tx.pwr.voltage = float(tx_volt) @@ -866,7 +871,10 @@ class OhmPi(object): self.switch_mux_off(quad) self.status = 'idle' - + + # if power was off before measurement, let's turn if off + if switch_power_off: + self._hw.pwr_state = 'off' # # # TODO if interrupted, we would need to restore the values # # TODO or we offer the possibility in 'run_measurement' to have rs_check each time?