labscript-suite / labscript-devices

A modular and extensible plugin architecture to control experiment hardware using the 𝘭𝘒𝘣𝘴𝘀𝘳π˜ͺ𝘱𝘡 𝘴𝘢π˜ͺ𝘡𝘦.
http://labscriptsuite.org
Other
5 stars 58 forks source link

tekscope starting issue (with solution) #64

Closed ispielma closed 3 years ago

ispielma commented 4 years ago

The bug is when blacs starts it throws an error having to do with starting h5_lock before h5.

The beginning of the blacs worker file currently looks like:

import time import numpy as np from blacs.tab_base_classes import Worker import labscript_utils.properties

class TekScopeWorker(Worker): def init(self): global h5py; import labscript_utils.h5_lock, h5py global TekScope from .TekScope import TekScope self.scope = TekScope(self.addr, termination=self.termination) manufacturer, model, sn, revision = self.scope.idn.split(',') assert manufacturer.lower() == 'tektronix' "Device is made by {:s}, not by Tektronix, and is actually a {:s}".format(manufacturer, model) print('Connected to {} (SN: {})'.format(model, sn))

But it should be like:

import time import numpy as np import labscript_utils.h5_lock import h5py

from blacs.tab_base_classes import Worker import labscript_utils.properties

class TekScopeWorker(Worker): def init(self): global TekScope from .TekScope import TekScope self.scope = TekScope(self.addr, termination=self.termination) manufacturer, model, sn, revision = self.scope.idn.split(',') assert manufacturer.lower() == 'tektronix' "Device is made by {:s}, not by Tektronix, and is actually a {:s}".format(manufacturer, model) print('Connected to {} (SN: {})'.format(model, sn))