def tearDown(self): Instrument.close_all()
def setUp(self): Instrument.close_all()
The script will run immediately as an anonymous script. Args: program: A list of program instructions. One line per list item, e.g. ['for ii = 1, 10 do', 'print(ii)', 'end' ] """ mainprog = '\r\n'.join(program) + '\r\n' wrapped = 'loadandrunscript\r\n{}endscript\n'.format(mainprog) if debug: log.debug('Wrapped the following script:') log.debug(wrapped) return wrapped if __name__ == "__main__": try: # ats_inst.close() # acquisition_controller.close() Instrument.close_all() except KeyError: pass except NameError: pass Bfield = Keithley_2600(name='Bfield', address="GPIB::26::INSTR") # Bfield.smua.curr.set(0e-6) print(Bfield.smua.sourcerange_i.get()) Instrument.close_all()
def _close_before_and_after(): Instrument.close_all() try: yield finally: Instrument.close_all()
def close_all_instruments(): """Makes sure that after startup and teardown, all instruments are closed""" Instrument.close_all() yield Instrument.close_all()