diff --git a/ohmpi/hardware_system.py b/ohmpi/hardware_system.py index 4ef57096213f9f1b14184665ae20451dd0159fa6..a4d1a9e6836f00d973ff4de8858f3fa05892de12 100644 --- a/ohmpi/hardware_system.py +++ b/ohmpi/hardware_system.py @@ -623,6 +623,9 @@ class OhmPiHardware: self.tx.voltage = vab else: vab = self.tx.voltage + if self.tx.pwr.pwr_state == 'off': + self.tx.pwr.pwr_state = 'on' + switch_pwr_off = True # reads current and voltage during the pulse injection = Thread(target=self._inject, kwargs={'injection_duration': duration, 'polarity': polarity}) readings = Thread(target=self._read_values, kwargs={'sampling_rate': sampling_rate, 'append': append}) @@ -631,7 +634,8 @@ class OhmPiHardware: readings.join() injection.join() self.tx.polarity = 0 #TODO: is this necessary? - + if switch_pwr_off: + self.tx.pwr.pwr_state = 'off' def _vab_pulses(self, vab, durations, sampling_rate, polarities=None, append=False): switch_pwr_off, switch_tx_pwr_off = False, False if self.pwr_state == 'off': diff --git a/ohmpi/ohmpi.py b/ohmpi/ohmpi.py index 78df6fe1f46e7b937c5bbda36af5f7fd194eba11..f5295447e3c453f849f49a2fe0740d88c5ea25d7 100644 --- a/ohmpi/ohmpi.py +++ b/ohmpi/ohmpi.py @@ -821,9 +821,7 @@ class OhmPi(object): for i in range(0, quads.shape[0]): quad = quads[i, :] # quadrupole self._hw.switch_mux(electrodes=list(quads[i, :2]), roles=['A', 'B'], state='on') - print('tx', self._hw.tx.voltage) self._hw._vab_pulse(duration=0.2, vab=tx_volt) - print('tx', self._hw.tx.voltage) current = self._hw.readings[-1, 3] # if self._hw.tx.pwr.voltage_adjustable: # print('tx',self._hw.tx.voltage)