instrument_cluster

InstrumentCluster class wrapping HV, LV and AdcBoard for multiple modules

This module also contains the DummyInstrument, DummyFunction and InstrumentNotInstantiated classes, and MissingRequiredInstrumentError and BadStatusForOperationError exceptions.

Classes

DummyInstrument(instrument)

Filler class to replace an instrument in the cluster that has not been provided or instantiated.

InstrumentCluster([instrument_dict, ...])

Instrument cluster class designed to provide seamless access to a cluster consisting of HV, LV, Relay Board and Multimeter, with required protections to ensure these are only used in safe configurations.

InstrumentNotInstantiated()

Filler class to replace response from a missing instrument in the cluster.

Exceptions

BadStatusForOperationError

Error to be thrown if an instrument has incorrect status for the requested operation.

MissingRequiredInstrumentError

Error to be thrown if an instrument required for the cluster is missing.

DummyInstrument

class icicle.instrument_cluster.DummyInstrument(instrument)

Bases: object

Filler class to replace an instrument in the cluster that has not been provided or instantiated.

All calls to any possible function should return an InstrumentNotInstantiated object, except init, enter, exit…

__init__(instrument)
class DummyFunction(instrument, name)

Bases: InstrumentNotInstantiated

InstrumentCluster

class icicle.instrument_cluster.InstrumentCluster(instrument_dict=None, channels_dict=None, resource='cluster1')

Bases: Instrument

Instrument cluster class designed to provide seamless access to a cluster consisting of HV, LV, Relay Board and Multimeter, with required protections to ensure these are only used in safe configurations.

__init__(instrument_dict=None, channels_dict=None, resource='cluster1')
class RB_Wrapper(parent_instrument, pins)

Bases: object

Class that handles multiple RB MeasureChannels Designed as a wrapper containing one MeasureChannel() object per pin

property pin_map
query_all()
query_pin(pin)
abort(*args, **kwargs)

Alias for off().

assert_status(status_check, required_status, operation, problem, proposed_solution, solution=None)

Assert that check_status returns True. If not, the user will be informed about

Parameters:
  • status_check – function to check the status of the system right now

  • current_status – the status the system has right now

  • required_status – the required state

  • operation – the operation that was performed

  • problem – the problem that was encountered

  • proposed_solution – How to solve the problem

  • solution – a function to run, if the problem can be solved automatically.

if there is no proposed solution, the programm will be terminated.

climate_chamber()

Getter method for the climate chamber

Returns:

climate chamber object

close(*args, **kwargs)

Alias for __exit__().

get_hv()

Returns list of hv instruments connected

Returns:

list of instruments that assume the role of HV in some channel (warning: changes to direct instruments may not be contained to only active channels!)

get_instruments()

Getter method to get the instruments used.

Returns:

instrument dictionary

get_lv()

Returns list of LV instruments connected

Returns:

list of instruments that assume the role of LV in some channel (warning: changes to direct instruments may not be contained to only active channels!)

get_modules()
Getter method to get the modules

(channels to each module in a dictionary).

Returns:

Module dictionary

hv_off(delay=None, step_size=None, measure=True, **kwargs)

Ramps down and turns off HV for each module

Loops through each module and turns its HV off

Parameters:
  • delay – delay between sweep steps (in seconds)

  • step_size – step size between sweep steps

  • measure – whether to measure at each step of sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

hv_off_module(module, delay=None, step_size=None, measure=True, **kwargs)

Ramps HV to zero and turns off.

Requires LV to be on.

Parameters:
  • module – the module for which HV is to be turned off

  • delay – delay between sweep steps (in seconds)

  • step_size – step size between sweep steps

  • measure – whether to measure at each step of sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

hv_on(voltage=None, delay=None, step_size=None, measure=True, **kwargs)

Turn on the HV for all modules

Loops through all modules and turns them on

Parameters:
  • voltage – Voltage to set on HV. Defaults on default_hv_voltage as specified on initialisation if None.

  • delay – delay between sweep steps (in seconds)

  • step_size – step size between sweep steps

  • measure – whether to measure at each step of sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

hv_on_module(module, voltage=None, delay=None, step_size=None, measure=True, **kwargs)

Turn on HV and ramps to voltage.

Requires LV to be on.

Parameters:
  • module – for which module the HV should be turned on

  • voltage – Voltage to set on HV. Defaults on default_hv_voltage as specified on initialisation if None.

  • delay – delay between sweep steps (in seconds)

  • step_size – step size between sweep steps

  • measure – whether to measure at each step of sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

hv_set(voltage=None, delay=None, step_size=None, measure=False, measure_args=None, **kwargs)

Sets the voltage of the HV for each module

Loops through each module and sets the HV.

Parameters:
  • voltage – voltage to be set for the HV

  • delay – delay between steps as the HV has to be swept

  • step_size – step size between steps in the sweep

:param measure - if this is True, the hv will measure the

output and voltage at each step.

:param measure_args - measurement parameters in case,

measurement is true. e.g. averages.

hv_set_module(module, voltage=None, delay=None, step_size=None, measure=False, measure_args=None, **kwargs)

Change HV voltage output for a single module.

Requires LV to be on.

Parameters:
  • voltage – voltage to be set for the HV

  • delay – delay between steps as the HV has to be swept

  • step_size – step size between steps in the sweep

:param measure - if this is True, the hv will measure the

output and voltage at each step.

:param measure_args - measurement parameters in case,

measurement is true. e.g. averages.

hv_set_ocp(compliance_current)

Sets the compliance current for all modules HV Loops through all modules and sets a compliance current for the HV

Parameters:

compliance_current – Compliance in Amps.

hv_set_ocp_module(module, compliance_current)

Set HV compliance current and corresponding sense current range.

Parameters:

compliance_current – Compliance in Amps.

lv_off(no_lock=False)

Turn off all LV

Loops through all modules and turns them off

lv_off_module(module)

Turn off LV.

Requires HV to be off.

Parameters:
  • module – The module for which the LV is to be turned off

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

lv_on(voltage=None, current=None)

Turn on all LV

Loops through all modules and turns them on

Parameters:
  • voltage – Voltage to set on LV.

  • current – Current to set on LV.

lv_on_module(module, voltage=None, current=None)

Turn on LV.

Requires HV to be off.

Parameters:
  • module – For which module the LV should be turned on.

  • voltage – Voltage to set on LV. Defaults on default_hv_voltage as specified on initialisation if None.

  • current – Current to set on LV. Defaults on default_hv_current as specified on initialisation if None.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

lv_sweep(target, delay, step_size, measure=False, **kwargs)
Perform sweep for all LV. Does a loop through all devices

(not performing simultaneously currently)

Parameters:
  • what – name of setting that set() call should target.

  • target – value of setting to sweep to (from current).

  • delay – delay between sweep steps (in seconds)

  • step_size – step size between sweep steps

  • lv_channel – Which LV channel is in use. Defaults to default_lv_channel as specified on initialisation if None.

  • measure – whether to measure at each step of sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

lv_sweep_module(module, target, delay, step_size, measure=False, **kwargs)

Sweep/Ramp LV from current to target voltage.

Requires HV to be off.

Parameters:
  • module – The module for which the lv should be swept

  • what – name of setting that set() call should target.

  • target – value of setting to sweep to (from current).

  • delay – delay between sweep steps (in seconds)

  • step_size – step size between sweep steps

  • lv_channel – Which LV channel is in use. Defaults to default_lv_channel as specified on initialisation if None.

  • measure – whether to measure at each step of sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

off(hv_delay=None, hv_step_size=None, measure=True, **kwargs)

Turns off all the channels for all modules Loops through all modules and turns off their channels in the correct order

Parameters:
  • hv_delay – delay between HV sweep steps (in seconds)

  • hv_step_size – step size between HV sweep steps

  • measure – whether to measure at each step of HV sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

off_module(module, hv_delay=None, hv_step_size=None, measure=False)

Turn all instruments off (and ramp down) in correct order.

Parameters:
  • hv_delay – delay between HV sweep steps (in seconds)

  • hv_step_size – step size between HV sweep steps

  • measure – whether to measure at each step of HV sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

on(lv_voltage=None, lv_current=None, hv_voltage=None, hv_delay=None, hv_step_size=None, measure=True, **kwargs)
Turn all instruments on (and ramp up) in correct order and with

sensible delays for all modules.

Parameters:
  • lv_voltage – Voltage to set on LV. Defaults on default_voltage as specified on initialisation if None.

  • lv_current – Current to set on LV. Defaults on default_current as specified on initialisation if None.

  • hv_voltage – Voltage to ramp to on HV. Defaults on default_voltage as specified on initialisation if None.

  • hv_delay – delay between HV sweep steps (in seconds)

  • hv_step_size – step size between HV sweep steps

  • measure – whether to measure at each step of HV sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

on_module(module, lv_voltage=None, lv_current=None, hv_voltage=None, hv_delay=None, hv_step_size=None, measure=False)
Turn all instruments on (and ramp up) in correct order and with

sensible delays.

Parameters:
  • relay_pin – Pin, see list/dict in the corresponding RelayBoard class.

  • lv_channel – Which LV channel is in use. Defaults to default_channel as specified on initialisation if None.

  • lv_voltage – Voltage to set on LV. Defaults on default_voltage as specified on initialisation if None.

  • lv_current – Current to set on LV. Defaults on default_current as specified on initialisation if None.

  • hv_voltage – Voltage to ramp to on HV. Defaults on default_voltage as specified on initialisation if None.

  • hv_delay – delay between HV sweep steps (in seconds)

  • hv_step_size – step size between HV sweep steps

  • measure – whether to measure at each step of HV sweep.

  • no_lock – Do not attempt to acquire lock. (@acquire_lock)

open(*args, **kwargs)

Alias for __enter__().

package_map = {'AdcBoard': 'adc_board', 'Binder': 'binder_climate_chamber', 'CaenDT8033N': 'caenDT8033N', 'DummyInstrument': 'dummy', 'HMP4040': 'hmp4040', 'HP34401A': 'hp34401a', 'Keithley2000': 'keithley2000', 'Keithley2410': 'keithley2410', 'KeysightE3633A': 'keysighte3633a', 'RelayBoard': 'relay_board', 'TTI': 'tti', 'TTITSX': 'ttiTSX'}
relay_pin_module(module, pin='OFF')

Set relay pin.

To be figured out: Current implementation is:

One pin = One channel object

Problem:

We would have to create a new channel object every time we change the pin… Also instantiating a relay board is much more difficult

remove_instrument(instrument_type)

Removes an instrument type from all modules

Parameters:

instrument_type – type of instrument to be removed

remove_instrument_module(module, instrument_type)

Remove an instrument from one module

Parameters:
  • module – module from which the instrument is to be removed

  • instrument_type – type of instrument to be removed

reset(*args, **kwargs)

Resets all instruments.

Parameters:
  • no_lock – Do not acquire lock for subinstruments. (@acquire_lock)

  • attempts

    Retry attempts for each subinstrument.

    (@retry_on_fail)

    Asserts, that HV and LV are turned off. If not, asks to turn both off.

sleep(delay)

Utility function to allow sleep to return True.

Parameters:

delay – Sleep time in seconds.

status(*args, **kwargs)

Requests the output/pin status of all the channels connected to all the modules

status_module(module, *args, **kwargs)

Request output/pin status for HV, LV and Relay board. Returns all results as dictionary.

InstrumentNotInstantiated

class icicle.instrument_cluster.InstrumentNotInstantiated

Bases: object

Filler class to replace response from a missing instrument in the cluster.

__init__()

BadStatusForOperationError

icicle.instrument_cluster.BadStatusForOperationError()

Error to be thrown if an instrument has incorrect status for the requested operation.

MissingRequiredInstrumentError

icicle.instrument_cluster.MissingRequiredInstrumentError()

Error to be thrown if an instrument required for the cluster is missing.