Exemplo n.º 1
0
Arquivo: PTS.py Projeto: avelo/Pythics
 def __init__(self, loc, **kwargs):
     self.board, self.address = loc.split('::')
     self.address_chr = chr(int(self.address)+32)
     session = vpp43.open_default_resource_manager()
     resource_name = vpp43.find_resources(session, self.board)[2]
     vpp43.open(session, resource_name)
     self.board_n = int(self.board.split('B')[1])
     gpib = visa.Gpib(self.board_n)
     vpp43.gpib_send_ifc(gpib.vi)
     vpp43.gpib_control_ren(gpib.vi, 1)
     self._frequency = None
     self._amplitude = None
Exemplo n.º 2
0
 def __init__(self, loc, **kwargs):
     self.board, self.address = loc.split('::')
     self.address_chr = chr(int(self.address) + 32)
     session = vpp43.open_default_resource_manager()
     resource_name = vpp43.find_resources(session, self.board)[2]
     vpp43.open(session, resource_name)
     self.board_n = int(self.board.split('B')[1])
     gpib = visa.Gpib(self.board_n)
     vpp43.gpib_send_ifc(gpib.vi)
     vpp43.gpib_control_ren(gpib.vi, 1)
     self._frequency = None
     self._amplitude = None
Exemplo n.º 3
0
    def __init__(self, name=None, wait_for_settle=True, reset=True):
        self.wait_for_settle = wait_for_settle

        if not name:
            instruments = visa.get_instruments_list()

            # find first GPIB interface
            for dev in instruments:
                if "gpib" in dev.lower():
                    name = dev
                    break
            else:
                raise exception('cannot find device')

        # connect to device and configure VISA settings
        self.device = visa.instrument(name)
        vpp43.gpib_control_ren(self.device.vi, visa.VI_GPIB_REN_ASSERT_ADDRESS) # doesn't work without this
        self.device.clear()
        
        self.set_output_enabled(False)
        if reset:
            self.reset()
Exemplo n.º 4
0
    def __init__(self, name=None, wait_for_settle=True, reset=True):
        self.wait_for_settle = wait_for_settle

        if not name:
            instruments = visa.get_instruments_list()

            # find first GPIB interface
            for dev in instruments:
                if "gpib" in dev.lower():
                    name = dev
                    break
            else:
                raise exception('cannot find device')

        # connect to device and configure VISA settings
        self.device = visa.instrument(name)
        vpp43.gpib_control_ren(
            self.device.vi,
            visa.VI_GPIB_REN_ASSERT_ADDRESS)  # doesn't work without this
        self.device.clear()

        self.set_output_enabled(False)
        if reset:
            self.reset()