relay_board

RelayBoard class for ETHZ Relayboard (Vasilije Perovic design).

Classes

RelayBoard(*args, **kwargs)

VisaInstrument implementation for ETHZ Relayboard (Vasilije Perovic design).

RelayBoardDOUBLE(*args, **kwargs)

RelayBoardQUAD(*args, **kwargs)

RelayBoardRD53A(*args, **kwargs)

RelayBoard

class icicle.relay_board.RelayBoard(*args, **kwargs)

Bases: VisaInstrument

VisaInstrument implementation for ETHZ Relayboard (Vasilije Perovic design).

Additional (fake) set(), query() commands have been added to make this a psuedo- implementation of SCPIInstrument (and match behaviour of said interface).

__init__(resource='ASRL20::INSTR', pin_map='QUAD', sim=False)
Parameters:
  • resource – VISA Resource address. See VISA docs for more info.

  • pin_map – Chooses the map to access different pins according to the version of the ROC (options: QUAD, DOUBLE)

BAUD_RATE = 9600

Serial link Baud rate.

MEASURE_WRAPPER_TYPES = {'GND': 'GND reference', 'GND_A': 'GND reference', 'IMUX_A': 'Analog IMUX A', 'IMUX_B': 'Analog IMUX B', 'NTC': 'HDI NTC', 'VDDA_A': 'Analog SLDO A', 'VDDA_B': 'Analog SLDO B', 'VDDA_ROC0': 'ROC0 analog SLDO', 'VDDA_ROC1': 'ROC1 analog SLDO', 'VDDA_ROC2': 'ROC2 analog SLDO', 'VDDA_ROC3': 'ROC3 analog SLDO', 'VDDD_A': 'Digital SLDO A', 'VDDD_B': 'Digital SLDO B', 'VDDD_ROC0': 'ROC0 digital SLDO', 'VDDD_ROC1': 'ROC1 digital SLDO', 'VDDD_ROC2': 'ROC2 digital SLDO', 'VDDD_ROC3': 'ROC3 digital SLDO', 'VMUX_A': 'Analog VMUX A', 'VMUX_B': 'Analog VMUX B'}
class MeasureChannelWrapper(wrapped_channel, channel, wrapper_type, relay_board)

Bases: MeasureChannelWrapper

MeasureChannel implementation for RelayBoard.

Wraps a Instrument.MeasureChannel on an appropriate measurement device, e.g. Keithley2000.

property status

Passes through status from wrapped channel.

property value

Performs measurement in wrapped MeasureChannel and returns transformed result.

Returns:

measured value.

Return type:

float

PIN_MAP = {'DOUBLE': {'GND_A': 'f', 'IMUX_A': 'a', 'IMUX_B': 'c', 'OFF': 'x', 'VDDA_ROC0': 'f', 'VDDA_ROC1': 'g', 'VDDD_ROC0': 'e', 'VDDD_ROC1': 'h', 'VMUX_A': 'b', 'VMUX_B': 'd'}, 'QUAD': {'GND': 'i', 'OFF': 'x', 'VDDA_ROC0': 'f', 'VDDA_ROC1': 'g', 'VDDA_ROC2': 'b', 'VDDA_ROC3': 'd', 'VDDD_ROC0': 'e', 'VDDD_ROC1': 'h', 'VDDD_ROC2': 'a', 'VDDD_ROC3': 'c', 'VIN': 'j'}, 'RD53A': {'GND': 'i', 'NTC': 'j', 'OFF': 'x', 'VDDA_ROC0': 'f', 'VDDA_ROC1': 'g', 'VDDA_ROC2': 'b', 'VDDA_ROC3': 'd', 'VDDD_ROC0': 'e', 'VDDD_ROC1': 'h', 'VDDD_ROC2': 'a', 'VDDD_ROC3': 'c'}}

Pin map for Arduino pin names.

Must match arduino firmware version.

READ_TERMINATION = ''
TIMEOUT = 5000

Serial link timeout (ms).

WRITE_TERMINATION = ''
off(**kwargs)

Set connected pin to OFF.

Parameters:
  • no_lock – override acquire_lock (e.g. if lock already taken by function that off-call is nested within).

  • attempts – how many retries to give set command.

Returns:

result returned by relay board (usually pin number that has been connected/powered).

query(setting, **kwargs)

“Fake” entry point to extend common interface as much as possible.

Query currently connected pin. See query_pin().

Parameters:
  • setting – must be PIN.

  • no_lock – override acquire_lock (e.g. if lock already taken by function that query-call is nested within).

  • attempts – how many retries to give set command.

Returns:

pin name as in PIN_MAP.

query_pin()

Query currently connected pin, return pin name as in PIN_MAP.

Parameters:
  • no_lock – override acquire_lock (e.g. if lock already taken by function that query_pin-call is nested within).

  • attempts – how many retries to give set command.

Returns:

pin name as in PIN_MAP.

set(setting, value, **kwargs)

“Fake” entry point to extend common interface as much as possible.

Set currently connected pin on relay board to pin. See set_pin().

Parameters:
  • setting – must be PIN.

  • value – pin name in PIN_MAP.

  • no_lock – override acquire_lock (e.g. if lock already taken by function that set-call is nested within).

  • attempts – how many retries to give set command.

Returns:

result returned by relay board (usually pin number that has been connected/powered).

set_pin(pin)

Set currently connected pin on relay board to pin.

Parameters:
  • pin – pin name in PIN_MAP.

  • no_lock – override acquire_lock (e.g. if lock already taken by function that set_pin-call is nested within).

  • attempts – how many retries to give set command.

Returns:

result returned by relay board (usually pin number that has been connected/powered).

status(**kwargs)

Queries currently connected pin, returns raw result.

Parameters:
  • no_lock – override acquire_lock (e.g. if lock already taken by function that status-call is nested within).

  • attempts – how many retries to give set command.

Returns:

result returned by relay board (usually pin number that has been connected/powered).

validate_channel(channel, raise_exception=True)

Check if an channel exists on this device. Only successful if channel == 1.

Parameters:

channel – Channel number to validate as an input

RelayBoardDOUBLE

class icicle.relay_board.RelayBoardDOUBLE(*args, **kwargs)

Bases: RelayBoard

__init__(resource='ASRL20::INSTR', sim=False)
Parameters:
  • resource – VISA Resource address. See VISA docs for more info.

  • pin_map – Chooses the map to access different pins according to the version of the ROC (options: QUAD, DOUBLE)

MEASURE_WRAPPER_TYPES = {'GND_A': 'GND reference', 'IMUX_A': 'Analog IMUX A', 'IMUX_B': 'Analog IMUX B', 'VDDA_A': 'Analog SLDO A', 'VDDA_B': 'Analog SLDO B', 'VDDD_A': 'Digital SLDO A', 'VDDD_B': 'Digital SLDO B', 'VMUX_A': 'Analog VMUX A', 'VMUX_B': 'Analog VMUX B'}

RelayBoardQUAD

class icicle.relay_board.RelayBoardQUAD(*args, **kwargs)

Bases: RelayBoard

__init__(resource='ASRL20::INSTR', sim=False)
Parameters:
  • resource – VISA Resource address. See VISA docs for more info.

  • pin_map – Chooses the map to access different pins according to the version of the ROC (options: QUAD, DOUBLE)

MEASURE_WRAPPER_TYPES = {'GND': 'GND reference', 'NTC': 'HDI NTC', 'VDDA_ROC0': 'ROC0 analog SLDO', 'VDDA_ROC1': 'ROC1 analog SLDO', 'VDDA_ROC2': 'ROC2 analog SLDO', 'VDDA_ROC3': 'ROC3 analog SLDO', 'VDDD_ROC0': 'ROC0 digital SLDO', 'VDDD_ROC1': 'ROC1 digital SLDO', 'VDDD_ROC2': 'ROC2 digital SLDO', 'VDDD_ROC3': 'ROC3 digital SLDO'}

RelayBoardRD53A

class icicle.relay_board.RelayBoardRD53A(*args, **kwargs)

Bases: RelayBoard

__init__(resource='ASRL20::INSTR', sim=False)
Parameters:
  • resource – VISA Resource address. See VISA docs for more info.

  • pin_map – Chooses the map to access different pins according to the version of the ROC (options: QUAD, DOUBLE)

MEASURE_WRAPPER_TYPES = {'GND': 'GND reference', 'NTC': 'HDI NTC', 'VDDA_ROC0': 'ROC0 analog SLDO', 'VDDA_ROC1': 'ROC1 analog SLDO', 'VDDA_ROC2': 'ROC2 analog SLDO', 'VDDA_ROC3': 'ROC3 analog SLDO', 'VDDD_ROC0': 'ROC0 digital SLDO', 'VDDD_ROC1': 'ROC1 digital SLDO', 'VDDD_ROC2': 'ROC2 digital SLDO', 'VDDD_ROC3': 'ROC3 digital SLDO'}