Stahl Drivers¶
Classes:
Stahl(name, address, **kwargs)
Stahl driver.
StahlChannel(parent, name, channel_number, ...)
A Stahl source channel
- classqcodes.instrument_drivers.stahl.Stahl(name:str , address:str , **kwargs:Unpack[VisaInstrumentKWArgs ])[source] ¶
Bases:
VisaInstrumentStahl 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:
The default terminator to use if the terminator is not specified when creating the instrument.
ChannelList of channels
Parameter temperature
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.
- channels:ChannelList [StahlChannel ]=self.add_submodule( "channel", channels )¶
ChannelList of channels
- 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
- timeout:Parameter [float |None ,Self]=self.add_parameter( "timeout", get_cmd=self._get_visa_timeout, set_cmd=self._set_visa_timeout, unit="s", vals=vals.MultiType(vals.Numbers(min_value=0), vals.Enum(None)), )¶
- 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
InstrumentModuleof this instrument Usually populated viaadd_submodule().
- log:InstrumentLoggerAdapter=get_instrument_logger(self, __name__)¶
- ask_raw(cmd:str ) → str [source] ¶
Sometimes the instrument returns non-ascii characters in response strings manually adjust the encoding to latin-1
- staticparse_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:
- classqcodes.instrument_drivers.stahl.StahlChannel(parent:Stahl , name:str , channel_number:int , **kwargs:Unpack[InstrumentBaseKWArgs ])[source] ¶
Bases:
InstrumentChannel[Stahl]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='\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
InstrumentModuleof this instrument Usually populated viaadd_submodule().
- log:InstrumentLoggerAdapter=get_instrument_logger(self, __name__)¶