Stahl Drivers

Classes:

Stahl(name, address, **kwargs)

Stahl driver.

StahlChannel(parent, name, channel_number, ...)

A Stahl source channel

class qcodes.instrument_drivers.stahl.Stahl(name: str, address: str, **kwargs: Unpack[VisaInstrumentKWArgs])[source]

Bases: VisaInstrument

Stahl driver.

Parameters:
  • name – instrument name

  • address – A serial port or TCP/IP VISA address

  • **kwargs – forwarded to base class

The TCP/IP scenario can be used when the Stahl is connected to a different computer, for example a Raspberry Pi running Linux, and exposed using something like the following script:

#!/bin/sh
DEVICE=/dev/ttyUSB0
PORT=8088
echo Listening...
while socat $DEVICE,echo=0,b115200,raw tcp-listen:$PORT,reuseaddr,nodelay; do
    echo Restarting...
done

In this case the VISA address would be: "TCPIP0::hostname::8088::SOCKET"

Attributes:

default_terminator

The default terminator to use if the terminator is not specified when creating the instrument.

temperature

Parameter temperature

identifier

Methods:

ask_raw(cmd)

Sometimes the instrument returns non-ascii characters in response strings manually adjust the encoding to latin-1

parse_idn_string(idn_string)

get_idn()

The Stahl sends a uncommon IDN string which does not include a firmware version.

default_terminator: str | None = '\r'

The default terminator to use if the terminator is not specified when creating the instrument. None means use the default terminator from PyVisa.

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

Parameter temperature

ask_raw(cmd: str) str[source]

Sometimes the instrument returns non-ascii characters in response strings manually adjust the encoding to latin-1

visabackend: str = visabackend
visa_handle: pyvisa.resources.MessageBasedResource = visa_handle

The VISA resource used by this instrument.

visalib: str | None = visalib
parameters: dict[str, ParameterBase] = {}

All the parameters supported by this instrument. Usually populated via add_parameter().

functions: dict[str, Function] = {}

All the functions supported by this instrument. Usually populated via add_function().

submodules: dict[str, InstrumentModule | ChannelTuple] = {}

All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via add_submodule().

instrument_modules: dict[str, InstrumentModule] = {}

All the InstrumentModule of this instrument Usually populated via add_submodule().

log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)
metadata: dict[str, Any] = {}
static parse_idn_string(idn_string: str) dict[str, Any][source]
Returns:

The dict contains the following keys “model”, “serial_number”, “voltage_range”,”n_channels”, “output_type”

Return type:

dict

get_idn() dict[str, str | None][source]

The Stahl sends a uncommon IDN string which does not include a firmware version.

property identifier: str
class qcodes.instrument_drivers.stahl.StahlChannel(parent: VisaInstrument, name: str, channel_number: int, **kwargs: Unpack[InstrumentBaseKWArgs])[source]

Bases: InstrumentChannel

A Stahl source channel

Parameters:
  • parent – Parent instrument

  • name – Name of the channel

  • channel_number – The channel number

  • **kwargs – kwargs to be passed to the base class

Attributes:

acknowledge_reply

voltage

Parameter voltage

current

Parameter current

is_locked

Parameter is_locked

acknowledge_reply = '\x06'
voltage: Parameter = self.add_parameter( "voltage", get_cmd=f"{self.parent.identifier} U{self._channel_string}", get_parser=chain( re.compile(f"^({_FLOATING_POINT_RE})[ ]?V$").findall, partial(re.sub, ",", "."), float, ), set_cmd=self._set_voltage, unit="V", vals=Numbers(-self.parent.voltage_range, self.parent.voltage_range), )

Parameter voltage

current: Parameter = self.add_parameter( "current", get_cmd=f"{self.parent.identifier} I{self._channel_string}", get_parser=chain( re.compile(f"^({_FLOATING_POINT_RE})[ ]?mA$").findall, partial(re.sub, ",", "."), lambda ma: float(ma) / 1000, # Convert mA to A ), unit="A", )

Parameter current

is_locked: Parameter = self.add_parameter( "is_locked", get_cmd=self._get_lock_status )

Parameter is_locked

parameters: dict[str, ParameterBase] = {}

All the parameters supported by this instrument. Usually populated via add_parameter().

functions: dict[str, Function] = {}

All the functions supported by this instrument. Usually populated via add_function().

submodules: dict[str, InstrumentModule | ChannelTuple] = {}

All the submodules of this instrument such as channel lists or logical groupings of parameters. Usually populated via add_submodule().

instrument_modules: dict[str, InstrumentModule] = {}

All the InstrumentModule of this instrument Usually populated via add_submodule().

log: InstrumentLoggerAdapter = get_instrument_logger(self, __name__)
metadata: dict[str, Any] = {}