예제 #1
0
    def __init__(self, parent, name, slot, min_val=-5, max_val=5):
        super().__init__(parent, name)

        # Validate slot and channel values
        self._SLOT_VAL.validate(slot)
        self._slot = slot

        # Store whether we have access to the VERSADAC EEPROM
        self._VERSA_EEPROM_available = self._parent._VERSA_EEPROM_available

        # Create a list of channels in the slot
        channels = ChannelList(self, "Slot_Channels", parent.DAC_CHANNEL_CLASS)
        for i in range(4):
            channels.append(parent.DAC_CHANNEL_CLASS(self, "Chan{}".format(i), i,
                                       min_val=min_val, max_val=max_val))
        self.add_submodule("channels", channels)
        # Set the slot mode. Valid modes are:
        #   Off: Channel outputs are disconnected from the input, grounded with 10MOhm.
        #   Fine: 2-channel mode. Channels 0 and 1 are output, use 2 and 3 for fine
        #       adjustment of Channels 0 and 1 respectively
        #   Coarse: All 4 channels are used as output
        #   FineCald: Calibrated 2-channel mode, with 0 and 1 output, 2 and 3 used
        #       automatically for fine adjustment. This mode only works for calibrated
        #       DecaDAC's
        # Unfortunately there is no known way of reading the slot mode hence this will be
        # set in initialization
        if self._parent._cal_supported:
            slot_modes = {"Off": 0, "Fine": 1, "Coarse": 2, "FineCald": 3}
        else:
            slot_modes = {"Off": 0, "Fine": 1, "Coarse": 2}
        self.add_parameter('slot_mode', get_cmd="m;", get_parser=self._dac_parse, set_cmd="M{};",
                           val_mapping=slot_modes)

        # Enable all slots in coarse mode.
        self.slot_mode.set(self.SLOT_MODE_DEFAULT)
예제 #2
0
    def __init__(self, name: str, address: str, **kwargs):
        super().__init__(name, address, terminator="\r", **kwargs)
        self.visa_handle.baud_rate = 115200

        instrument_info = self.parse_idn_string(self.ask("IDN"))

        for key, value in instrument_info.items():
            setattr(self, key, value)

        channels = ChannelList(self,
                               "channel",
                               StahlChannel,
                               snapshotable=False)

        for channel_number in range(1, self.n_channels + 1):
            name = f"channel{channel_number}"
            channel = StahlChannel(self, name, channel_number)
            self.add_submodule(name, channel)
            channels.append(channel)

        self.add_submodule("channel", channels)

        self.add_parameter("temperature",
                           get_cmd=f"{self.identifier} TEMP",
                           get_parser=chain(
                               re.compile("^TEMP (.*)°C$").findall, float),
                           unit="C")

        self.connect_message()
예제 #3
0
파일: HMC804x.py 프로젝트: qutech/Qcodes
    def __init__(self, name: str, address: str, num_channels: int,
                 **kwargs: Any) -> None:
        super().__init__(name, address, **kwargs)

        self.max_current = _RohdeSchwarzHMC804x._max_currents[num_channels]

        self.add_parameter('state',
                           label='Output enabled',
                           set_cmd='OUTPut:MASTer:STATe {}',
                           get_cmd='OUTPut:MASTer:STATe?',
                           val_mapping={
                               'ON': 1,
                               'OFF': 0
                           },
                           vals=vals.Enum('ON', 'OFF'))

        # channel-specific parameters
        channels = ChannelList(self,
                               "SupplyChannel",
                               RohdeSchwarzHMC804xChannel,
                               snapshotable=False)
        for ch_num in range(1, num_channels + 1):
            ch_name = f"ch{ch_num}"
            channel = RohdeSchwarzHMC804xChannel(self, ch_name, ch_num)
            channels.append(channel)
            self.add_submodule(ch_name, channel)
        self.add_submodule("channels", channels.to_channel_tuple())

        self.connect_message()
예제 #4
0
    def __init__(self, parent, name, slot, default_switch_pos=DacBase._DEFAULT_SWITCH_POS):
        """
        Initialize the slot

        Arguments:
            parent (Decadac):       Decadac object this slot belongs to
            name (str):             name of the slot
            slot (int):             number of the slot
            switch (int):           switch position of all channels of this slot
            mode (int):             slot mode (MODE_OFF, MODE_FINE, MODE_COARSE)
        
        Attributes:
            name (str):             name of the slot
            channels (ChannelList): list of channels in this slot
            mode (int):             slot mode (MODE_OFF, MODE_FINE, MODE_COARSE)
        """
        InstrumentChannel.__init__(self, parent, name)
        
        DacSlot._SLOT_VAL.validate(slot)
        self.number = slot

        channels = ChannelList(self, "Slot_Chans", DacChannel)
        
        for channel in range(4):
            channels.append(DacChannel(self, "Chan{}".format(channel), channel, default_switch_pos=default_switch_pos))
        
        self.add_submodule("channels", channels)
        
        self.add_parameter("mode", get_cmd=self._get_mode, set_cmd=self._set_mode, vals=self._MODE_VAL, label="Slot Mode")
예제 #5
0
파일: Decadac.py 프로젝트: kdp22/Qcodes
class DacSlot(InstrumentChannel, DacReader):
    """
    A single DAC Slot of the DECADAC
    """
    _SLOT_VAL = vals.Ints(0, 5)

    def __init__(self, parent, name, slot, min_val=-5, max_val=5):
        super().__init__(parent, name)

        # Validate slot and channel values
        self._SLOT_VAL.validate(slot)
        self._slot = slot

        # Store whether we have access to the VERSADAC EEPROM
        self._VERSA_EEPROM_available = self._parent._VERSA_EEPROM_available

        # Create a list of channels in the slot
        self.channels = ChannelList(self, "Slot_Channels", DacChannel)
        for i in range(4):
            self.channels.append(DacChannel(self, "Chan{}".format(i), i))

        # Set the slot mode. Valid modes are:
        #   Off: Channel outputs are disconnected from the input, grounded with 10MOhm.
        #   Fine: 2-channel mode. Channels 0 and 1 are output, use 2 and 3 for fine
        #       adjustment of Channels 0 and 1 respectively
        #   Coarse: All 4 channels are used as output
        #   FineCald: Calibrated 2-channel mode, with 0 and 1 output, 2 and 3 used
        #       automatically for fine adjustment. This mode only works for calibrated
        #       DecaDAC's
        # Unfortunately there is no known way of reading the slot mode hence this will be
        # set in initialization
        if self._parent._cal_supported:
            slot_modes = {"Off": 0, "Fine": 1, "Coarse": 2, "FineCald": 3}
        else:
            slot_modes = {"Off": 0, "Fine": 1, "Coarse": 2}
        self.add_parameter('slot_mode',
                           get_cmd="m;",
                           get_parser=self._dac_parse,
                           set_cmd="M{};",
                           val_mapping=slot_modes)

        # Enable all slots in coarse mode.
        self.slot_mode.set("Coarse")

    def write(self, cmd):
        """
        Overload write to set channel prior to any channel operations.
        Since all commands are echoed back, we must keep track of responses
        as well, otherwise commands receive the wrong response.
        """
        self._set_slot()
        return self.ask_raw(cmd)

    def ask(self, cmd):
        """
        Overload ask to set channel prior to operations
        """
        self._set_slot()
        return self.ask_raw(cmd)
예제 #6
0
    def __init__(self, name):
        super().__init__(name)

        # Add gates to the device
        gates = ChannelList(self, "gates", GateWrapper)
        self.add_submodule("gates", gates)

        # Add ohmics to the device
        ohmics = ChannelList(self, "ohmics", OhmicWrapper)
        self.add_submodule("ohmics", ohmics)
예제 #7
0
class LakeshoreBase(VisaInstrument):
    """
    This base class has been written to be that base for the Lakeshore 336
    and 372. There are probably other lakeshore modes that can use the
    functionality provided here. If you add another lakeshore driver
    please make sure to extend this class accordingly, or create a new one.

    In order to use a variation of the `BaseSensorChannel` class for sensor
    channels, just set `CHANNEL_CLASS` to that variation of the class inside
    your `LakeshoreBase`'s subclass.

    In order to add heaters (output channels) to the driver, add `BaseOutput`
    instances (subclasses of those) in your `LakeshoreBase`'s subclass
    constructor via `add_submodule` method.
    """
    # Redefine this in the model-specific class in case you want to use a
    # different class for sensor channels
    CHANNEL_CLASS = BaseSensorChannel

    # This dict has channel name in the driver as keys, and channel "name" that
    # is used in instrument commands as values. For example, if channel called
    # "B" is referred to in instrument commands as '2', then this dictionary
    # will contain {'B': '2'} entry.
    channel_name_command: Dict[str, str] = {}

    input_channel_parameter_values_to_channel_name_on_instrument: Dict[Any, str]

    def __init__(self,
                 name: str,
                 address: str,
                 terminator: str ='\r\n',
                 **kwargs
                 ) -> None:
        super().__init__(name, address, terminator=terminator, **kwargs)

        # Allow access to channels either by referring to the channel name
        # or through a channel list, i.e. instr.A.temperature() and
        # instr.channels[0].temperature() refer to the same parameter.
        self.channels = ChannelList(self, "TempSensors",
                                    self.CHANNEL_CLASS, snapshotable=False)
        for name, command in self.channel_name_command.items():
            channel = self.CHANNEL_CLASS(self, name, command)
            self.channels.append(channel)
            self.add_submodule(name, channel)
        self.channels.lock()
        self.add_submodule("channels", self.channels)

        self.connect_message()
예제 #8
0
    def __init__(self, name: str, address: str) -> None:
        log.debug("Opening Newport_AG_UC8 at %s" % address)

        super().__init__(name,
                         address,
                         timeout=self.default_timeout,
                         terminator="\r\n")
        self.visa_handle.baud_rate = 912600

        self._current_channel: Optional[int] = None

        channels = [
            Newport_AG_UC8_Channel(self, channel_number)
            for channel_number in range(1, 4 + 1)
        ]

        channel_list = ChannelList(self, "channels", Newport_AG_UC8_Channel,
                                   channels)

        self.add_submodule("channels", channel_list)

        self.add_function("reset", call_cmd=self.reset, args=())

        # Set controller in remote mode (otherwise many commands don't work).
        self.write("MR")
예제 #9
0
    def __init__(self, name,
                 alazar_name: str,
                 filter: str = 'win',
                 numtaps: int =101,
                 **kwargs) -> None:
        super().__init__(name, alazar_name, **kwargs)
        self.filter_settings = {'filter': self.filter_dict[filter],
                                'numtaps': numtaps}
        self.number_of_channels = 2

        channels = ChannelList(self, "Channels", AlazarChannel,
                               multichan_paramclass=AlazarMultiChannelParameter)
        self.add_submodule("channels", channels)

        self.add_parameter(name='int_time',
                           check_and_update_fn=self._update_int_time,
                           default_fn=self._int_time_default,
                           parameter_class=AcqVariablesParam)
        self.add_parameter(name='int_delay',
                           check_and_update_fn=self._update_int_delay,
                           default_fn=self._int_delay_default,
                           parameter_class=AcqVariablesParam)
        self.add_parameter(name='samples_per_record',
                           alternative='int_time and int_delay',
                           parameter_class=NonSettableDerivedParameter)

        self.samples_divisor = self._get_alazar().samples_divisor

        self.shape_info = {}
        self.active_channels_nested = []
        self.board_info = self._get_alazar().get_idn()
예제 #10
0
    def __init__(self,
                 name: str,
                 address: str,
                 min_val: number = -5,
                 max_val: number = 5,
                 **kwargs) -> None:
        """

        Creates an instance of the Decadac instruments

        Args:
            name: What this instrument is called locally.

            address: The address of the DAC. For a serial port this
                is ASRLn::INSTR where n is replaced with the address set in the
                VISA control panel. Baud rate and other serial parameters must
                also be set in the VISA control panel.

            min_val: The minimum value in volts that can be output by the DAC.
                This value should correspond to the DAC code 0.

            max_val: The maximum value in volts that can be output by the DAC.
                This value should correspond to the DAC code 65536.

        """

        super().__init__(name, address, **kwargs)

        # Do feature detection
        self._feature_detect()

        # Create channels
        channels = ChannelList(self,
                               "Channels",
                               self.DAC_CHANNEL_CLASS,
                               snapshotable=False)
        slots = ChannelList(self, "Slots", self.DAC_SLOT_CLASS)
        for i in range(5):  # Create the 6 DAC slots
            slots.append(
                self.DAC_SLOT_CLASS(self, f"Slot{i}", i, min_val, max_val))
            slot_channels = slots[i].channels
            slot_channels = cast(ChannelList, slot_channels)
            channels.extend(slot_channels)
        self.add_submodule("slots", slots.to_channel_tuple())
        self.add_submodule("channels", channels.to_channel_tuple())

        self.connect_message()
예제 #11
0
    def __init__(self, instrument: NI_Switch, name: str, raw_name: str):
        super().__init__(instrument, name)

        self._session = self.root_instrument.session
        self.raw_name = raw_name
        self.connection_list = ChannelList(self.root_instrument,
                                           "connections",
                                           type(self),
                                           snapshotable=False)

        self.add_parameter(
            "connections",
            docstring="The value of this read-only parameter "
            "is a list of the names of the channels "
            "to which this channel is connected to.",
            get_cmd=self._read_connections,
            set_cmd=False,
        )
예제 #12
0
 def __init__(
     self,
     name: str,
 ):
     super().__init__(name)
     channel = VoltageChannel(self, "voltage")
     channellist = ChannelList(self,
                               "cl",
                               VoltageChannel,
                               chan_list=[channel])
     self.add_submodule("voltage", channellist)
예제 #13
0
    def __init__(self,
                 name: str,
                 address: str,
                 terminator: str ='\r\n',
                 **kwargs
                 ) -> None:
        super().__init__(name, address, terminator=terminator, **kwargs)

        # Allow access to channels either by referring to the channel name
        # or through a channel list, i.e. instr.A.temperature() and
        # instr.channels[0].temperature() refer to the same parameter.
        self.channels = ChannelList(self, "TempSensors",
                                    self.CHANNEL_CLASS, snapshotable=False)
        for name, command in self.channel_name_command.items():
            channel = self.CHANNEL_CLASS(self, name, command)
            self.channels.append(channel)
            self.add_submodule(name, channel)
        self.channels.lock()
        self.add_submodule("channels", self.channels)

        self.connect_message()
예제 #14
0
    def __init__(self, name: str, address: str, login_name: str,
                 login_password: str, **kwargs):

        super().__init__(name, **kwargs)

        # save access settings
        self.address = address

        # set up http connection
        password_manager = urllib.request.HTTPPasswordMgrWithDefaultRealm()
        password_manager.add_password(None, self.address, login_name,
                                      login_password)
        handler = urllib.request.HTTPBasicAuthHandler(password_manager)
        opener = urllib.request.build_opener(handler)
        urllib.request.install_opener(opener)

        # add channels
        channels = ChannelList(self,
                               "PowerChannels",
                               PowerChannel,
                               snapshotable=False)
        for id_name in PowerChannel.CHANNEL_IDS.keys():
            channel = PowerChannel(self, 'Chan{}'.format(id_name), id_name)
            channels.append(channel)
            self.add_submodule(id_name, channel)
        channels.lock()
        self.add_submodule("channels", channels)

        # print connect message
        self.connect_message()
예제 #15
0
    def __init__(self, name: str, address: str, **kwargs) -> None:
        """
        Args:
            name: Name to use internally in QCoDeS.
            address: VISA resource address
        """
        super().__init__(name, address, terminator='\n', **kwargs)

        channels = ChannelList(self, "Channels", AimTTiChannel,
                               snapshotable=False)

        _model = self.get_idn()['model']

        _numOutputChannels = {'PL068-P': 1, 'PL155-P': 1, 'PL303-P': 1,
                             'PL601-P': 1, 'PL303QMD-P': 2, 'PL303QMT': 3}

        if (not _model in _numOutputChannels.keys()) or (_model is None):
            raise NotKnownModel("Unknown model, connection cannot be "
                                "established.")

        self.numOfChannels = _numOutputChannels[_model]
        for i in range(1, self.numOfChannels+1):
            channel = AimTTiChannel(self, f'ch{i}', i)
            channels.append(channel)
            self.add_submodule(f'ch{i}', channel)

        channels.lock()
        self.add_submodule('channels', channels)
        self.connect_message()
예제 #16
0
파일: DP8xx.py 프로젝트: yuiponpon/Qcodes
    def __init__(self, name: str, address: str,
                 channels_ranges: Sequence[Tuple[float, float]],
                 ovp_ranges: Tuple[Sequence[Tuple[float, float]],
                                   Sequence[Tuple[float, float]]],
                 ocp_ranges: Tuple[Sequence[Tuple[float, float]],
                                   Sequence[Tuple[float,
                                                  float]]], **kwargs: Any):
        super().__init__(name, address, **kwargs)

        # Check if precision extension has been installed
        opt = self.installed_options()
        if 'DP8-ACCURACY' in opt:
            ovp_ranges_selected = ovp_ranges[1]
            ocp_ranges_selected = ocp_ranges[1]
        else:
            ovp_ranges_selected = ovp_ranges[0]
            ocp_ranges_selected = ocp_ranges[0]

        # channel-specific parameters
        channels = ChannelList(self,
                               "SupplyChannel",
                               RigolDP8xxChannel,
                               snapshotable=False)
        for ch_num, channel_range in enumerate(channels_ranges):
            ch_name = "ch{}".format(ch_num + 1)
            channel = RigolDP8xxChannel(self, ch_name, ch_num + 1,
                                        channel_range,
                                        ovp_ranges_selected[ch_num],
                                        ocp_ranges_selected[ch_num])
            channels.append(channel)
            self.add_submodule(ch_name, channel)
        channels.lock()
        self.add_submodule("channels", channels)

        self.connect_message()
예제 #17
0
    def __init__(self, name, address, num_channels, **kwargs):
        super().__init__(name, address, **kwargs)

        self.max_current = _RohdeSchwarzHMC804x._max_currents[num_channels]

        self.add_parameter('state',
                           label='Output enabled',
                           set_cmd='OUTPut:MASTer:STATe {}',
                           get_cmd='OUTPut:MASTer:STATe?',
                           val_mapping={
                               'ON': 1,
                               'OFF': 0
                           },
                           vals=vals.Enum('ON', 'OFF'))

        # channel-specific parameters
        channels = ChannelList(self,
                               "SupplyChannel",
                               RohdeSchwarzHMC804xChannel,
                               snapshotable=False)
        for ch_num in range(1, num_channels + 1):
            ch_name = "ch{}".format(ch_num)
            channel = RohdeSchwarzHMC804xChannel(self, ch_name, ch_num)
            channels.append(channel)
            self.add_submodule(ch_name, channel)
        channels.lock()
        self.add_submodule("channels", channels)
        # add bipolar virtual channel 1/2
        bip = RohdeSchwarzHMC804xBIP(self, 'bip', self.ch1, self.ch2)
        self.add_submodule("bip", bip)
        self.connect_message()
예제 #18
0
    def __init__(self, name, address, model_no, **kwargs):
        super().__init__(name, address, terminator="\n", **kwargs)
        self.model_no = model_no

        self.add_parameter('state',
                           label='Output enabled',
                           set_cmd='OUTPut:GENeral {}',
                           get_cmd='OUTPut:GENeral?',
                           val_mapping={
                               'ON': 1,
                               'OFF': 0
                           },
                           vals=vals.Enum('ON', 'OFF'))
        # number of channels can be calculated from model number
        num_channels = (self.model_no % 100) // 10
        # channel-specific parameters
        channels = ChannelList(self,
                               "SupplyChannel",
                               RohdeSchwarzHMPChannel,
                               snapshotable=False)
        for ch_num in range(1, num_channels + 1):
            ch_name = "ch{}".format(ch_num)
            channel = RohdeSchwarzHMPChannel(self, ch_name, ch_num)
            channels.append(channel)
            self.add_submodule(ch_name, channel)
        channels.lock()
        self.add_submodule("channels", channels)

        self.connect_message()
예제 #19
0
    def __init__(self, name: str, address: str, **kwargs: Any) -> None:

        super().__init__(name, address, terminator="\n", **kwargs)

        self.add_submodule("horizontal",
                           TektronixDPOHorizontal(self, "horizontal"))

        self.add_submodule("data", TektronixDPOData(self, "data"))

        self.add_submodule("waveform",
                           TektronixDPOWaveformFormat(self, "waveform"))

        measurement_list = ChannelList(self, "measurement",
                                       TektronixDPOMeasurement)
        for measurement_number in range(1, self.number_of_measurements):

            measurement_name = f"measurement{measurement_number}"
            measurement_module = TektronixDPOMeasurement(
                self, measurement_name, measurement_number)

            self.add_submodule(measurement_name, measurement_module)
            measurement_list.append(measurement_module)

        self.add_submodule("measurement", measurement_list)
        self.add_submodule(
            "statistics",
            TektronixDPOMeasurementStatistics(self, "statistics"))

        channel_list = ChannelList(self, "channel", TektronixDPOChannel)
        for channel_number in range(1, self.number_of_channels + 1):

            channel_name = f"channel{channel_number}"
            channel_module = TektronixDPOChannel(
                self,
                channel_name,
                channel_number,
            )

            self.add_submodule(channel_name, channel_module)
            channel_list.append(channel_module)

        self.add_submodule("channel", channel_list)

        self.add_submodule("trigger", TekronixDPOTrigger(self, "trigger"))

        self.add_submodule(
            "delayed_trigger",
            TekronixDPOTrigger(self, "delayed_trigger", delayed_trigger=True))

        self.connect_message()
예제 #20
0
    def __init__(self,
                 name: str,
                 resource: str,
                 name_mapping: Optional[Dict[str, str]] = None,
                 reset_device: bool = False,
                 niswitch_kw: Optional[Dict] = None,
                 **kwargs):

        super().__init__(name=name, **kwargs)
        if name_mapping is None:
            name_mapping = {}
        if niswitch_kw is None:
            niswitch_kw = {}
        self.session = Session(resource,
                               reset_device=reset_device,
                               **niswitch_kw)

        new_channels = ChannelList(self, "all_channels", SwitchChannel)
        for i in range(self.session.channel_count):
            raw_name = self.session.get_channel_name(i + 1)
            alias = name_mapping.get(raw_name, raw_name)
            ch = SwitchChannel(self, alias, raw_name)
            new_channels.append(ch)
        new_channels.lock()
        self.add_submodule("channels", new_channels)
        self.snapshot(update=True)  # make all channels read their conenctions

        self.connect_message()
예제 #21
0
    def __init__(self,
                 name: str,
                 address: str,
                 terminator: str = '\r\n',
                 **kwargs: Any) -> None:
        super().__init__(name, address, terminator=terminator, **kwargs)

        # Allow access to channels either by referring to the channel name
        # or through a channel list, i.e. instr.A.temperature() and
        # instr.channels[0].temperature() refer to the same parameter.
        # Note that `snapshotable` is set to false in order to avoid duplicate
        # snapshotting which otherwise will happen because each channel is also
        # added as a submodule to the instrument.
        channels = ChannelList(self,
                               "TempSensors",
                               self.CHANNEL_CLASS,
                               snapshotable=False)
        for name, command in self.channel_name_command.items():
            channel = self.CHANNEL_CLASS(self, name, command)
            channels.append(channel)
            self.add_submodule(name, channel)
        channels.lock()
        self.add_submodule("channels", channels)

        self.connect_message()
예제 #22
0
    def __init__(self,
                 name,
                 address,
                 active_channels={
                     'A': 'cernox',
                     'B': 'diode'
                 },
                 **kwargs):
        super().__init__(name, address, terminator="\r\n", **kwargs)

        # Allow access to channels either by referring to the channel name
        # or through a channel list.
        # i.e. Model_340.A.temperature() and Model_340.channels[0].temperature()
        # refer to the same parameter.

        # Serial parameters if instrument is connected via RS-232:
        # self.visa_handle.baud_rate = 57600
        # self.visa_handle.stop_bits = visa.constants.StopBits.one
        # self.visa_handle.parity = visa.constants.Parity.odd
        # self.visa_handle.data_bits = 7
        channels = ChannelList(self,
                               "TempSensors",
                               SensorChannel34x,
                               snapshotable=False)
        for chan_name, sensor_name in active_channels.items():
            channel = SensorChannel34x(self, chan_name, chan_name, sensor_name)
            channels.append(channel)
            self.add_submodule(chan_name, channel)
        channels.lock()
        self.add_submodule("channels", channels)
        ###############
        self.add_parameter(name='set_temperature',
                           get_cmd='SETP?',
                           get_parser=float,
                           set_cmd='SETP 1,{}',
                           label='Set Temperature',
                           vals=Numbers(0.3, 300),
                           unit='K')
        self.add_parameter(name='heater_range',
                           get_cmd='RANGE?',
                           get_parser=int,
                           set_cmd='RANGE {}',
                           label='Heater range',
                           vals=Enum(0, 1, 2, 3, 4, 5),
                           unit='')
        self.add_parameter(name='ramp_rate',
                           get_cmd='RAMP? 1',
                           get_parser=str,
                           set_cmd='RAMP 1,1,{}',
                           label='Heater range',
                           vals=Numbers(min_value=0),
                           unit='K/min')
        self.add_parameter(name='analog_out_config',
                           get_cmd='ANALOG? 1',
                           get_parser=str,
                           label='Analog output configuration.',
                           unit='')
        #############
        self.connect_message()
예제 #23
0
    def __init__(self,
                 name,
                 address,
                 active_channels={
                     'ch1': '50K Plate',
                     'ch2': '3K Plate'
                 },
                 **kwargs):
        super().__init__(name, address, terminator="\r\n", **kwargs)

        # Allow access to channels either by referring to the channel name
        # or through a channel list.
        # i.e. Model_335.A.temperature() and Model_335.channels[0].temperature()
        # refer to the same parameter.

        # Serial parameters if instrument is connected via RS-232:
        # self.visa_handle.baud_rate = 57600
        # self.visa_handle.stop_bits = visa.constants.StopBits.one
        # self.visa_handle.parity = visa.constants.Parity.odd
        # self.visa_handle.data_bits = 7
        channels = ChannelList(self,
                               "TempSensors",
                               SensorChannel372,
                               snapshotable=False)
        for chan_name, sensor_name in active_channels.items():
            channel = SensorChannel372(self, 'Chan{}'.format(chan_name),
                                       chan_name, sensor_name)
            channels.append(channel)
            self.add_submodule(chan_name, channel)
        channels.lock()
        self.add_submodule("channels", channels)
        ###############
        # self.add_parameter(name='set_temperature',
        #            get_cmd='SETP?',
        #            get_parser=float,
        #            set_cmd='SETP 1,{}',
        #            label='Set Temerature',
        #            vals=Numbers(4, 300),
        #            unit='K')
        # self.add_parameter(name='heater_range',
        #            get_cmd='RANGE?',
        #            get_parser=int,
        #            set_cmd='RANGE 1,{}',
        #            label='Heater range',
        #            vals=Enum(0, 1, 2, 3),
        #            unit='')
        # self.add_parameter(name='ramp_rate',
        #            get_cmd='RAMP? 1',
        #            get_parser=str,
        #            set_cmd='RAMP 1,1,{}',
        #            label='Heater range',
        #            vals=Numbers(min_value=0),
        #            unit='K/min')
        ##############
        self.connect_message()
예제 #24
0
    def __init__(self, name, chan_count=25):
        super().__init__(name)

        self.chan_count = chan_count

        channels = ChannelList(self, "channels", BBChan)
        for i in range(chan_count):
            channel = BBChan(self, f"ch{i+1:02}")
            channels.append(channel)
            self.add_submodule(f"ch{i+1:02}", channel)
        channels.lock()
        self.add_submodule("channels", channels)
예제 #25
0
    def __init__(self, name: str, address: str, **kwargs):
        super().__init__(name, address, terminator="\r\n", **kwargs)

        # add channels
        channels = ChannelList(self,
                               "TempSensors",
                               SensorChannel,
                               snapshotable=False)
        for channel_id in ('A', 'B'):
            channel = SensorChannel(self, 'Chan{}'.format(channel_id),
                                    channel_id)
            channels.append(channel)
            self.add_submodule(channel_id, channel)
        channels.lock()
        self.add_submodule("channels", channels)

        # add parameters
        self.add_parameter('heater_output',
                           get_cmd='HTR?',
                           get_parser=float,
                           label='heater output',
                           unit='%')

        self.add_parameter('heater_range',
                           get_cmd='RANGE?',
                           get_parser=int,
                           set_cmd='RANGE {}',
                           val_mapping={
                               'off': 0,
                               '0.5W': 1,
                               '5W': 2,
                               '50W': 3
                           },
                           label='heater range')

        self.add_parameter('input',
                           get_cmd='CSET? %i' % self._loop,
                           set_cmd='CSET ' + str(self._loop) + ',{},1,1,1',
                           get_parser=lambda ans: ans[0],
                           label='input')

        self.add_parameter('setpoint',
                           get_cmd='SETP? ' + str(self._loop),
                           set_cmd='SETP ' + str(self._loop) + ', {}',
                           get_parser=float,
                           label='setpoint',
                           unit='K')

        # print connect message
        self.connect_message()
예제 #26
0
    def __init__(self, name):
        super().__init__(name)

        # Add digital gates to the device
        digital_gates = ChannelList(self, "digital_gates", DigitalGateWrapper)
        self.add_submodule("digital_gates", digital_gates)

        # Add digital parameters
        self._v_high = 1.8
        self._v_low = 0
        self.add_parameter("v_high",
                           initial_value=1.8,
                           get_cmd=partial(getattr, self, "_v_high"),
                           set_cmd=self._update_vhigh,
                           vals=Numbers())
        self.add_parameter("v_low",
                           initial_value=0,
                           get_cmd=partial(getattr, self, "_v_low"),
                           set_cmd=self._update_vlow,
                           vals=Numbers())
예제 #27
0
 def __init__(self, name, address, **kwargs):
     super().__init__(name, address, **kwargs)
     channels = ChannelList(self, "TempSensors", SensorChannel, snapshotable=False)
     for chan_name in ('A', 'B'):
         channel = SensorChannel(self, chan_name, chan_name)
         channels.append(channel)
         self.add_submodule(chan_name, channel)
     channels.lock()
     self.add_submodule("channels", channels)
     self.connect_message()
     
     # Enable overtemp protection.
     self.write('OVER:SOUR A')
     self.write('OVER:TEMP 310')
     self.write('OVER:ENAB ON')
예제 #28
0
    def __init__(self, name, address, **kwargs):
        super().__init__(name, address, terminator="\r\n", **kwargs)
        channels = ChannelList(self,
                               "TempSensors",
                               SensorChannel,
                               snapshotable=False)
        for chan_name in ('A', 'B'):
            channel = SensorChannel(self, 'Chan{}'.format(chan_name),
                                    chan_name)
            channels.append(channel)
            self.add_submodule(chan_name, channel)
        channels.lock()
        self.add_submodule("channels", channels)

        self.connect_message()
예제 #29
0
    def __init__(self, name, address, **kwargs):
        super().__init__(name, address, terminator="\r\n", **kwargs)

        # Allow access to channels either by referring to the channel name
        # or through a channel list.
        # i.e. Model_336.A.temperature() and Model_336.channels[0].temperature()
        # refer to the same parameter.
        channels = ChannelList(self, "TempSensors", SensorChannel, snapshotable=False)
        for chan_name in ('A', 'B', 'C', 'D'):
            channel = SensorChannel(self, 'Chan{}'.format(chan_name), chan_name)
            channels.append(channel)
            self.add_submodule(chan_name, channel)
        channels.lock()
        self.add_submodule("channels", channels)

        self.connect_message()
예제 #30
0
파일: DG1062.py 프로젝트: spauka/Qcodes
    def __init__(self, name: str, address: str,
                 **kwargs: Any):

        super().__init__(name, address, terminator="\n", **kwargs)

        channels = ChannelList(self, "channel", DG1062Channel,
                               snapshotable=False)

        for ch_num in [1, 2]:
            ch_name = f"ch{ch_num}"
            channel = DG1062Channel(self, ch_name, ch_num)
            channels.append(channel)
            self.add_submodule(ch_name, channel)

        channels.lock()
        self.add_submodule("channels", channels)
        self.connect_message()