Ejemplo n.º 1
0
    def handle(self):
        logger.info("New connection %s" % (self.client_address[0], ))

        assert isinstance(self.server, GPIBTCPSever)
        logger.debug("Opening instrument %d" % (self.server.dev_id, ))
        self.instrument = Gpib.Gpib(0, self.server.dev_id)

        while True:
            try:
                self.data = self.rfile.readline().strip()
                if not self.data:
                    return
            except Exception as e:
                self.data = None

            if self.data:
                logger.debug("T(%s)> %s..." %
                             (self.client_address[0], self.data[:30]))

                logger.debug("G(%d)< %s..." %
                             (self.server.dev_id, self.data[:10]))
                self.instrument.write(self.data)

            iread_data = self.instrument.read(1000)

            if iread_data:
                logger.debug("G(%d)> %s" %
                             (self.server.dev_id, iread_data[:10]))

                logger.debug("T(%s)< %s" %
                             (self.client_address[0], iread_data[:10]))
                self.wfile.write(iread_data)
Ejemplo n.º 2
0
 def __init__(self, name):
     self.name = name
     self.inst = Gpib.Gpib(name)
     self.curr = np.zeros(1)
     self.pid_value = np.zeros(1)
     self.curr_range = 0
     self.update_curr_range()
Ejemplo n.º 3
0
    def register(self):
        if self.ui_target:
            self.topvbox = gtk.VBox(False, 0)
            self.ui_target.pack_start(self.topvbox, False, False, 5)
            self.ui_target.show_all()

        self.lock = threading.Lock()
        try:
            self.lock.acquire()

            devname = helpers.devmap_remap("%s:dev" % (DEVICENAME))
            assert devname, "Did not find %s in devmap" % (DEVICENAME)
            self.alias = helpers.devmap_remap("%s:alias" % (DEVICENAME))
            assert self.alias, "Did not find alias for %s" % (DEVICENAME)

            self.Keithley = Gpib.Gpib(devname)
            self.Keithley.clear()

            self.Keithley.write('*RST')
            self.Keithley.write(':SOUR:FUNC VOLT')
            self.Keithley.write(':SOUR:VOLT:RANG 20')
            self.Keithley.write(':SENS:FUNC "CURR"')
            self.Keithley.write(':SENS:CURR:PROT 15e-3')
            self.Keithley.write(':SENS:CURR:RANG 100e-3')
            self.Keithley.write(':SENS:CURR:NPLC 0.1')
            self.Keithley.write('OUTP ON')
        finally:
            self.lock.release()

        self.Keithley.state = self.K_read_V()
Ejemplo n.º 4
0
 def __init__(self, gpib, refhp, name):
     self.gpib = gpib
     self.inst = Gpib.Gpib(0, self.gpib,
                           timeout=60)  # 3458A GPIB Address = self.gpib
     self.refhp = refhp
     self.name = name
     self.init_inst()
Ejemplo n.º 5
0
    def register(self):
        self.lock = threading.Lock()

        devname = helpers.devmap_remap("%s:dev" % (DEVICENAME))
        assert devname, "Did not find %s in devmap" % (DEVICENAME)
        self.alias = helpers.devmap_remap("%s:alias" % (DEVICENAME))
        assert self.alias, "Did not find alias for %s" % (DEVICENAME)

        self.dmm = Gpib.Gpib(devname)
        self.dmm.clear()
        time.sleep(.1)
        self.dmm.range = .1
        self.set_speed(self.dmm, 'NORM')

        if self.ui_target:
            self.speedchoice = gtk.combo_box_entry_new_text()
            for string in ['NORM', 'FAST', 'SLOW']:
                self.speedchoice.append_text(string)
            iter = self.speedchoice.get_model().get_iter_first()
            self.speedchoice.set_active_iter(iter)
            self.speedchoice.connect("changed", self.set_speed_clicked)

            dmmspeed = gtk.Label("%s" % (self.alias))
            self.tophbox = gtk.HBox(False, 5)
            self.tophbox.pack_start(dmmspeed, True, True, 5)
            self.tophbox.pack_start(self.speedchoice, True, True, 5)

            self.ui_target.pack_start(self.tophbox, False, False, 5)
            self.ui_target.show_all()
Ejemplo n.º 6
0
    def __init__(self,
                 name='gpib0',
                 pad=None,
                 sad=0,
                 timeout=13,
                 send_eoi=1,
                 eos_mode=0):

        if name.upper().startswith('GPIB') and '::' in name:
            res = parse_visa_resource_string(name)

            if res is None:
                raise IOError("Invalid resource string")

            index = res['prefix'][4:]
            if len(index) > 0:
                index = int(index)
            else:
                index = 0

            addr = int(res['arg1'])

            name = index
            pad = addr

        self.gpib = Gpib.Gpib(name, pad, sad, timeout, send_eoi, eos_mode)
Ejemplo n.º 7
0
    def __init__(self):
        if test_flag != 'test':
            if config['interface'] == 'gpib':
                try:
                    import Gpib
                    self.status_flag = 1
                    self.device = Gpib.Gpib(config['board_address'], config['gpib_address'])
                    try:
                        pass
                        # test should be here
                        #self.device_write('*CLS')

                    except BrokenPipeError:
                        general.message("No connection")
                        self.status_flag = 0
                        sys.exit()
                except BrokenPipeError:
                    general.message("No connection")
                    self.status_flag = 0
                    sys.exit()

            else:
                general.message("Incorrect interface setting")
                self.status_flag = 0
                sys.exit()

        elif test_flag == 'test':
            pass
Ejemplo n.º 8
0
    def register_gpib_device(self, adress):

        try:
            self.devices[adress] = Gpib.Gpib(0, adress)

            return {"status": "registered", "adress": adress}
        except:
            return {"status": "registration_failed", "adress": adress}
Ejemplo n.º 9
0
 def __init__(self,
              name='gpib0',
              pad=None,
              sad=0,
              timeout=13,
              send_eoi=1,
              eos_mode=0):
     self.gpib = Gpib.Gpib(name, pad, sad, timeout, send_eoi, eos_mode)
Ejemplo n.º 10
0
    def __init__(self, gpib):

        self.meter = Gpib.Gpib(0, gpib)
        self.meter.write("*RST")

        # Query IDN to make sure it works
        self.meter.write("*IDN?")
        print self.meter.read(100)
Ejemplo n.º 11
0
 def __init__(self, gpib, reflevel, name):
     self.gpib = gpib
     self.inst = Gpib.Gpib(0, self.gpib,
                           timeout=60)  # SCPI GPIB Address = self.gpib
     self.reflevel = reflevel
     self.name = name
     self.tec_rtd = tec_rtd
     self.init_inst()
Ejemplo n.º 12
0
    def __init__(self, gpib):
        self.source = Gpib.Gpib(0, gpib)

        # Zero Voltages
        self.source.write("VSET 1,0")
        self.source.write("VSET 2,0")
        # Outputs off
        self.source.write("OUT 1,0")
        self.source.write("OUT 2,0")
Ejemplo n.º 13
0
 def __init__(self):
     if test_flag != 'test':
         if config['interface'] == 'gpib':
             try:
                 import Gpib
                 self.status_flag = 1
                 self.device = Gpib.Gpib(config['board_address'],
                                         config['gpib_address'])
                 try:
                     # test should be here
                     self.status_flag = 1
                     self.device_write('*CLS')
                 except BrokenPipeError:
                     general.message("No connection")
                     self.status_flag = 0
                     sys.exit()
             except BrokenPipeError:
                 general.message("No connection")
                 self.status_flag = 0
                 sys.exit()
         elif config['interface'] == 'rs232':
             try:
                 self.status_flag = 1
                 rm = pyvisa.ResourceManager()
                 self.device = rm.open_resource(
                     config['serial_address'],
                     read_termination=config['read_termination'],
                     write_termination=config['write_termination'],
                     baud_rate=config['baudrate'],
                     data_bits=config['databits'],
                     parity=config['parity'],
                     stop_bits=config['stopbits'])
                 self.device.timeout = config['timeout']  # in ms
                 try:
                     # test should be here
                     self.status_flag = 1
                     self.device_write('*CLS')
                 except pyvisa.VisaIOError:
                     self.status_flag = 0
                     general.message("No connection")
                     sys.exit()
                 except BrokenPipeError:
                     general.message("No connection")
                     self.status_flag = 0
                     sys.exit()
             except pyvisa.VisaIOError:
                 general.message("No connection")
                 self.status_flag = 0
                 sys.exit()
             except BrokenPipeError:
                 general.message("No connection")
                 self.status_flag = 0
                 sys.exit()
     elif test_flag == 'test':
         pass
Ejemplo n.º 14
0
    def __init__(self, gpib):

        # Set Address
        # self.pulse = visa.instrument("GPIB::%s"%GPIB)

        # Set Address
        self.pulse = Gpib.Gpib(0, gpib)

        # Select Channel A and turn output off
        self.pulse.write("CHA")
        self.pulse.write("D1")
Ejemplo n.º 15
0
    def __init__(self, gpib):

        # Initialize the device and restore defaults
        self.inst = Gpib.Gpib(0, gpib)
        self.inst.write("*RST")

        # Query IDN to make sure it works
        self.inst.write("*IDN?")
        print self.inst.read(100)

        self.inst.write("SOUR:CLE:IMM")
Ejemplo n.º 16
0
Archivo: k182m.py Proyecto: tin-/teckit
 def __init__(self, gpib, reflevel, name):
     self.gpib = gpib
     if cfg.get('teckit', 'interface', 1) == 'gpib':
         self.inst = Gpib.Gpib(0, self.gpib, timeout=180)  # GPIB link
     elif cfg.get('teckit', 'interface', 1) == 'vxi':
         self.inst = vxi11.Instrument(cfg.get('teckit', 'vxi_ip', 1),
                                      "gpib0,%d" % self.gpib)  # VXI link
         self.inst.timeout = 180
     self.reflevel = reflevel
     self.name = name
     self.init_inst()
Ejemplo n.º 17
0
 def __init__(self,gpib,reflevel,name):
     self.gpib = gpib
     print "\033[4;5H \033[0;34mGPIB[\033[1m%2d\033[0;31m] : Fluke 8508A/01\033[0;39m" % self.gpib
     if cfg.get('teckit', 'interface', 1) == 'gpib':
         self.inst = Gpib.Gpib(0, self.gpib, timeout = 180) # GPIB link
     elif cfg.get('teckit', 'interface', 1) == 'vxi':
         self.inst = vxi11.Instrument(cfg.get('teckit', 'vxi_ip', 1), "gpib0,%d" % self.gpib) # VXI link
         self.inst.timeout = 180
     self.reflevel = reflevel
     self.name = name
     self.init_inst()
Ejemplo n.º 18
0
 def __init__(self, gpib, reflevel, name):
     self.gpib = gpib
     print "\033[7;5H \033[0;33mGPIB[\033[1m%2d\033[0;33m] : Fluke 1529\033[0;39m" % self.gpib
     if cfg.get('teckit', 'interface', 1) == 'gpib':
         self.inst = Gpib.Gpib(0, self.gpib, timeout=180)  # GPIB link
     elif cfg.get('teckit', 'interface', 1) == 'vxi':
         self.inst = vxi11.Instrument(cfg.get('teckit', 'trm_ip', 1),
                                      "gpib0,%d" % self.gpib)  # VXI link
         self.inst.timeout = 180
     self.name = name
     self.tec_rtd = tec_rtd
     self.init_inst()
Ejemplo n.º 19
0
 def __init__(self, gpib, reflevel, name):
     self.gpib = gpib
     print "\033[6;5H \033[0;31mGPIB[\033[1m%2d\033[0;31m] : Keysight B2987A\033[0;39m" % self.gpib
     if cfg.get('teckit', 'interface', 1) == 'gpib':
         self.inst = Gpib.Gpib(0, self.gpib, timeout=180)  # GPIB link
     elif cfg.get('teckit', 'interface', 1) == 'vxi':
         self.inst = vxi11.Instrument(cfg.get('teckit',
                                              'em_ip'))  # VXI link
         self.inst.timeout = 180
     self.reflevel = reflevel
     self.name = name
     self.init_inst_dummy()
Ejemplo n.º 20
0
 def __init__(self, boardId=0, resource_name=""):
     """
     Decodes the a resource name like GPIB0::13
     into the primary address (=13 in this example) then
     instantiates, and returns, a linux-gpib object
     """
     self.boardId = boardId
     #print "resource name = " , resource_name
     # GPIBAddress is something like "GPIB0::13"
     primaryAddress = int(resource_name[(resource_name.find("::") + 2):])
     #print "Gpib address = " , primaryAddress
     self.instrument = Gpib.Gpib(boardId, primaryAddress)
Ejemplo n.º 21
0
    def __init__(self, gpib, refhp, name):
        self.gpib = gpib

        print "\033[5;5H \033[0;36mGPIB[\033[1m%2d\033[0;36m] : Keysight 3458A\033[0;39m" % self.gpib
        if cfg.get('teckit', 'interface', 1) == 'gpib':
            self.inst = Gpib.Gpib(0, self.gpib, timeout=180)  # GPIB link
        elif cfg.get('teckit', 'interface', 1) == 'vxi':
            self.inst = vxi11.Instrument(cfg.get('teckit', 'vxi_ip', 1),
                                         "gpib0,%d" % self.gpib)  # VXI link
            self.inst.timeout = 180
        self.refhp = refhp
        self.name = name
        self.init_inst()
Ejemplo n.º 22
0
	def connect(self):
		try:
			self.device = Gpib.Gpib(self.host)
			self.identity = self.go('*IDN?')
			self.text.show(self.identity,'message')
			self.status	=	'connected'
			self.connected = True

		except socket.timeout:
			self.status = "socket timeout"
			self.identity = 'none'
			self.connected = False
		return self.identity
    def connect(self):
        """
		Make a connection to the device.
		"""

        log.info('Connecting to device "{0}" using {1} at "{2}".'.format(
            self.name, self.driver, self.connection_resource))

        if self.driver == drivers.pyvisa:
            try:
                self.device = visa.Instrument(**self.connection_resource)
            except visa.VisaIOError as e:
                raise DeviceNotFoundError(
                    'Could not open device at "{0}".'.format(
                        self.connection_resource), e)
        elif self.driver == drivers.lgpib:
            try:
                self.device = Gpib.Gpib(**self.connection_resource)
            except gpib.GpibError as e:
                raise DeviceNotFoundError(
                    'Could not open device at "{0}".'.format(
                        self.connection_resource), e)
        elif self.driver == drivers.pyvisa_usb:
            try:
                if not (legacyVisa):
                    rm = visa.ResourceManager()
                    self.device = rm.open_resource(**self.connection_resource)
                else:

                    class USBDevice(visa.Instrument):
                        """
						Using USB devices with PyVISA requires a small hack: the object must be an Instrument, but we can't call Instrument.__init__.
						"""
                        def __init__(self, *args, **kwargs):
                            # Bypass the initialization in visa.Instrument, due to "send_end" not being valid for USB.
                            visa.ResourceTemplate.__init__(
                                self, *args, **kwargs)

                    self.device = USBDevice(**self.connection_resource)

            except visa.VisaIOError as e:
                raise DeviceNotFoundError(
                    'Could not open device at "{0}".'.format(
                        self.connection_resource), e)

        try:
            self._connected()
        except Exception as e:
            raise DeviceNotFoundError(
                'Could not finish connection to device at "{0}".'.format(
                    self.connection_resource), e)
Ejemplo n.º 24
0
    def __init__(self):
        if test_flag != 'test':
            if config['interface'] == 'gpib':
                try:
                    import Gpib
                    self.status_flag = 1
                    self.device = Gpib.Gpib(config['board_address'],
                                            config['gpib_address'])
                    try:
                        #test should be here
                        self.status_flag = 1
                        # Switch off service requests
                        self.device_write('SR0')
                        # Switch to mode 0, i.e. field-controller mode via internal sweep-address-generator
                        self.device_write('MO0')
                        # Set IM0 sweep mode (we don't use it, just to make sure we don't trigger a sweep start inadvertently)
                        self.device_write('IM0')
                        # The device seems to need a bit of time after being switched to remote mode
                        general.wait('1 s')
                    except BrokenPipeError:
                        general.message("No connection")
                        self.device.close()
                        self.status_flag = 0
                        sys.exit()
                except BrokenPipeError:
                    general.message("No connection")
                    self.device.close()
                    self.status_flag = 0
                    sys.exit()

        elif test_flag == 'test':
            pass

        self.act_field = None  # the real current field
        self.is_act_field = False  # set if current field is known
        self.sf = None  # the current center field (CF) setting
        self.sw = None  # the current sweep width (SW) setting
        self.swa = None  # the current sweep address (SWA) setting
        self.is_sw = False  # set if sweep width is known
        self.max_sw = None  # maximum sweep width
        self.swa_step = None  # field step between two sweep addresses (SWAs)
        self.step_incr = None  # how many SWAs to step for a sweep step
        self.start_field = None  # the start field given by the user
        self.field_step = None  # the field steps to be used
        self.is_init = False  # flag, set if magnet_setup() has been called
        self.max_field_dev = 0.  # maximum field deviation (in test run)

        self.max_sw = max_sweep_width
        if self.max_sw > max_field - min_field:
            self.max_sw = max_field - min_field
Ejemplo n.º 25
0
 def __init__(self, deviceIBName, MAVmask=16,IfaceReadyMask=2):
     self.f = Gpib.Gpib(deviceIBName)
     #self.sbr.semafor = GPIB_semafor
     #self.sbr.semafor.acquire()
     print deviceIBName, ':clearing the device buffer...'
     self.clear()
     #self.sbr.semafor.release()
     #self.sbr.MAV = MAVmask    # how to detect the reading was don and response is available
     self.MAVmaks = MAVmask    # sets the message available mask
     self.IfaceReadyMask = IfaceReadyMask    # sets the interface ready mask
     self.CMDexec = 2    # command in execution MASK for the status byte
     self.deviceIBName = deviceIBName
     self.timer = LocalTimerClass()
     return
Ejemplo n.º 26
0
def setup_dmm(addr):
    inst = Gpib.Gpib(0, addr)
    inst.clear()
    inst.write("PRESET NORM")
    inst.write("OFORMAT ASCII")
    inst.write("DCV 10")
    inst.write("TARM HOLD")
    inst.write("TRIG AUTO")
    inst.write("NPLC 200")
    inst.write("NRDGS 1,AUTO")
    inst.write("MEM OFF")
    inst.write("END ALWAYS")
    inst.write("NDIG 9")
    inst.write("DISP OFF,\"                 \"")
    return inst
Ejemplo n.º 27
0
    def __init__(self):
        self.device = Gpib.Gpib(0, 20)

        # first write after reboot fails so add a retry mechanism
        self.device.timeout(9)  # 100 ms
        written = False
        while not written:
            try:
                self.device.write("L")
            except:
                pass
            else:
                written = True
                self.device.timeout(13)
        return
Ejemplo n.º 28
0
    def __init__(self, simulate=False):
        self.logger = get_logger(self.__class__.__name__)
        # self.conf = configurationFile(file = self.__class__.__name__)   a rajouter dans le fichier de configuration
        # self.pwrMeterConf = self.conf.getConfiguration()

        self.simulate = simulate
        if not self.simulate:
            self.logger.info('Init the power meter Anritsu')
            self.instrument = Gpib.Gpib(
                0, ANRITSU_ADRESS
            )  # remplacer ADRESS par l'adress du fichier de configuration

        else:
            self.logger.info('Power meter Anritsu in simulate')
            self.instrument = self._simulate()
Ejemplo n.º 29
0
    def register(self):
        self.lock = threading.Lock()

        self.lock.acquire()
        devname = helpers.devmap_remap("%s:dev" % (DEVICENAME))
        assert devname, "Did not find %s in devmap" % (DEVICENAME)
        self.alias = helpers.devmap_remap("%s:alias" % (DEVICENAME))
        assert self.alias, "Did not find alias for %s" % (DEVICENAME)

        self.psup = Gpib.Gpib(devname)
        self.psup.clear()
        time.sleep(.1)
        #self.psup.write('*RST')
        #self.psup.write('OUTP:ON')
        self.lock.release()
Ejemplo n.º 30
0
    def __init__(self):
        self.device = Gpib.Gpib(0, 5)
        # first write after reboot fails so add a retry mechanism
        self.device.timeout(9)  # 100 ms
        written = False
        while not written:
            try:
                self.device.write("*CLS")
            except:
                pass
            else:
                written = True
                self.device.timeout(13)

        self.device.write("INP:IMP:AUTO ON")
        self.device.write("CONF:VOLT:DC")
        return
Ejemplo n.º 31
0
class ATS2(object):
    def __init__(self):
        self.gpib  = Gpib('ats2'); 
        self.gpib.clear()
        

    def setAmpVppA(self, val):
        self.gpib.write(":AGEN:AMPL A,%fVPP" % val)

    def getAmpVppA(self):
        self.gpib.write(":AGEN:AMPL? A,VPP")
        response = self.gpib.read(1024)
        valmatch = re.search(":AGEN:AMPL A,([\d\.]+)VPP", response)
        return float(valmatch.groups()[0])
    
    ampVppA = property(getAmpVppA, setAmpVppA)

    def setAmpVppB(self, val):
        self.gpib.write(":AGEN:AMPL B,%fVPP" % val)


    def getAmpVppB(self):
        self.gpib.write(":AGEN:AMPL? B,VPP")
        response = self.gpib.read(1024)
        valmatch = re.search(":AGEN:AMPL B,([\d\.]+)VPP", response)
        return float(valmatch.groups()[0])
    
    ampVppB = property(getAmpVppB, setAmpVppB)

    def setOutput(self, val):
        if val == "bal":
            self.gpib.write(":AGEN:CONFIG BAL")
        elif val == "unbal":
            self.gpib.write(":AGEN:CONFIG UNBAL")
        else:
            raise TypeError

    def getOutput(self):
        self.gpib.write(":AGEN:CONFIG?")
        response = self.gpib.read(1024)
        valmatch = re.search(":AGEN:CONFIG (\w+)", response)
        if valmatch.groups()[0] == "BAL":
            return "bal"
        elif valmatch.groups()[0] == "UNBAL":
            return "unbal"
        else:
            raise TypeError
        
    output = property(getOutput, setOutput)

    def setFreq1(self, val):
        self.gpib.write(":AGEN:DASINE:FRQ1 %fHZ" % val)


    def getFreq1(self):
        self.gpib.write(":AGEN:DASINE:FRQ1? HZ")
        response = self.gpib.read(1024)
        valmatch = re.search(":AGEN:DASINE:FRQ1 ([\d\.]+)HZ", response)
        return float(valmatch.groups()[0])
    
    freq1 = property(getFreq1, setFreq1)

    def setFreq2(self, val):
        self.gpib.write(":AGEN:DASINE:FRQ2 %fHZ" % val)


    def getFreq2(self):
        self.gpib.write(":AGEN:DASINE:FRQ2? HZ")
        response = self.gpib.read(1024)
        valmatch = re.search(":AGEN:DASINE:FRQ2 ([\d\.]+)HZ", response)
        return float(valmatch.groups()[0])
    
    freq2 = property(getFreq2, setFreq2)

    def setMode(self, val):
        if val == Modes.SINE :
            self.gpib.write(":AGEN:WFM DASINE,STER")

    def getMode(self):
        self.gpib.write(":AGEN:WFM?")
        response = self.gpib.read(1024)
        print response
        if response == ":AGEN:WFM DASINE,STEREO\n":
            return Modes.SINE
        else:
            raise TypeError, "INvalid mode returned"

    mode = property(getMode, setMode)


    def setOnA(self, val):
        
        self.gpib.write(":AGEN:OUTPUT?")
        response = self.gpib.read(1024)
        if val:
            if response == ":AGEN:OUTPUT B\n":
                self.gpib.write(":AGEN:OUTPUT AB")
            else:
                self.gpib.write(":AGEN:OUTPUT A")
        else:
            if response == ":AGEN:OUTPUT AB\n":
                self.gpib.write(":AGEN:OUTPUT B")
            elif response == ":AGEN:OUTPUT B\n":
                pass
            else:
                self.gpib.write(":AGEN:OUTPUT OFF")
    
    def getOnA(self):
        self.gpib.write(":AGEN:OUTPUT?")
        response = self.gpib.read(1024)
        if response == ":AGEN:OUTPUT A\n":
            return True
        elif response == ":AGEN:OUTPUT AB\n":
            return True
        else:
            return False

    onA = property(getOnA, setOnA)
        
    def setOnB(self, val):
        
        self.gpib.write(":AGEN:OUTPUT?")
        response = self.gpib.read(1024)
        if val:
            if response == ":AGEN:OUTPUT A\n":
                self.gpib.write(":AGEN:OUTPUT AB")
            else:
                self.gpib.write(":AGEN:OUTPUT B")
        else:
            if response == ":AGEN:OUTPUT AB\n":
                self.gpib.write(":AGEN:OUTPUT A")
            elif response == ":AGEN:OUTPUT A\n":
                pass
            else:
                self.gpib.write(":AGEN:OUTPUT OFF")
    
    def getOnB(self):
        self.gpib.write(":AGEN:OUTPUT?")
        response = self.gpib.read(1024)
        if response == ":AGEN:OUTPUT B\n":
            return True
        elif response == ":AGEN:OUTPUT AB\n":
            return True
        else:
            return False

    onB = property(getOnB, setOnB)
Ejemplo n.º 32
0
 def __init__(self):
     self.gpib  = Gpib('ats2'); 
     self.gpib.clear()
Ejemplo n.º 33
0
from time import sleep
from Gpib import *

v = Gpib('voltmeter')

v.clear()

v.write('D0 Q0')

sleep(1)

for i in range(0,10):
	print v.read()