biologic: Driver for BioLogic potentiostats

This driver is a wrapper around BioLogic’s kbio package.

Note

This driver is Windows-only.

Driver Configuration

The biologic driver requires the following settings in the Settings file:

  • [drivers.biologic.dllpath] pointing to the folder of the EC-Lib Development library;

  • [drivers.biologic.lockfile] pointing to a file to be used as a lock file for the DLL.

Supported method parameters:

General parameters

Parameter

Type

Meaning

technique

Literal["constant_current", "constant_voltage", "sweep_current", "sweep_voltage", "open_circuit_voltage", "loop"]

see below

time

Union[int,float]

total runtime of the method, in s

I_range

Literal["100 pA", "1 nA", "10 nA", "100 nA", "1 uA", "10 uA", "100 uA", "1 mA", "10 mA", "100 mA", "1 A"]

maximum current available to the method

E_range

Literal["+-2.5 V", "+-5.0 V", "+-10 V"]

voltage range used by the method

record_every_dt

Union[int,float]

delay between datapoints, in s

is_delta

bool = False

is the setpoint a delta (True) or absolute (False)

Technique limits

Parameter

Type

Meaning

limit_current_max

Union[int,float,str]

maximum allowed current, can be a C-rate

limit_current_min

Union[int,float,str]

minimum allowed current, can be a C-rate

limit_voltage_max

Union[int,float]

maximum allowed voltage

limit_voltage_min

Union[int,float]

minimum allowed voltage

exit_on_limit

bool = False

abort when limit reached (True) or continue (False)

Controlled current and voltage techniques

Parameter

Type

Meaning

current

Union[int,float,str]

current setpoint, can be a C-rate, in A

record_every_dE

Union[int,float]

maximum spacing between datapoints, in V

voltage

Union[int,float]

voltage setpoint, in V

record_every_dI

Union[int,float]

maximum spacing between datapoints, in A

scan_rate

float

sweep rate of setpoint, in V/s or A/s

Loop parameters

Parameter

Type

Meaning

n_gotos

int = 0

number of jumps - 0 means no looping.

goto

int

zero-indexed index of the method to jump to

Supported techniques:

  • open_circuit_voltage: Measure the OCV of the cell. Supports the following parameters:
    • time

    • record_every_dt and record_every_dE

    • I_range and E_range

  • constant_current: Run a cell in CC mode - chronopotentiometry. Supports the following parameters:
    • time

    • current and is_delta

    • record_every_dt and record_every_dE

    • all of the Technique limits.

  • constant_voltage: Run a cell in CV mode - chronoamperometry. Supports the following parameters:
    • time

    • voltage and is_delta

    • record_every_dt and record_every_dI

    • all of the Technique limits.

  • sweep_current: Run a cell in LSC mode - linear sweep of current. Supports the following parameters:
    • time

    • current, scan_rate and is_delta

    • record_every_dt and record_every_dE

    • all of the Technique limits.

  • sweep_voltage: Run a cell in LSV mode - linear sweep of voltage. Supports the following parameters:
    • time

    • voltage, scan_rate and is_delta

    • record_every_dt and record_every_dI

    • all of the Technique limits.

  • loop: Arbitrary loop of techniques. Supports the following parameters:
    • n_gotos and goto

Code author: Peter Kraus

Subpackages

Submodules

tomato.drivers.biologic.kbio_wrapper.get_test_magic(variable, sign, logic='or', active=True)
Return type

int

tomato.drivers.biologic.kbio_wrapper.get_num_steps(tech)
Return type

int

tomato.drivers.biologic.kbio_wrapper.pad_steps(param, ns)
Return type

list

tomato.drivers.biologic.kbio_wrapper.current(val, capacity)
Return type

Union[list[float], float]

tomato.drivers.biologic.kbio_wrapper.vlimit(cond, vals, Is=None)
Return type

list[float]

tomato.drivers.biologic.kbio_wrapper.translate(technique, capacity)
Return type

dict

tomato.drivers.biologic.kbio_wrapper.dsl_to_ecc(api, dsl)
Return type

EccParams

tomato.drivers.biologic.kbio_wrapper.payload_to_ecc(api, payload, capacity)
Return type

list[dict]

tomato.drivers.biologic.kbio_wrapper.parse_raw_data(api, data, devname)
tomato.drivers.biologic.kbio_wrapper.get_kbio_api(dllpath)
tomato.drivers.biologic.kbio_wrapper.get_kbio_techpath(dllpath, techname, devname)
Return type

str

tomato.drivers.biologic.main.get_status(address, channel, jobqueue, logger, dllpath=None, lockpath=None, **kwargs)

Get the current status of the device.

Parameters
  • address (str) – IP address of the potentiostat.

  • channel (int) – Numeric, 1-indexed ID of the channel.

  • dllpath (Optional[str]) – Path to the BioLogic DLL file.

Returns

timestamp, ready, metadata – Returns a tuple containing the timestamp, readiness status, and associated metadata.

Return type

tuple[float, bool, dict]

tomato.drivers.biologic.main.get_data(address, channel, jobqueue, logger, dllpath=None, lockpath=None, **kwargs)

Get cached data from the device.

Parameters
  • address (str) – IP address of the potentiostat.

  • channel (int) – Numeric, 1-indexed ID of the channel.

  • dllpath (Optional[str]) – Path to the BioLogic DLL file.

Returns

timestamp, nrows, data – Returns a tuple containing the timestamp and associated metadata.

Return type

tuple[float, int, dict]

tomato.drivers.biologic.main.start_job(address, channel, jobqueue, logger, payload, dllpath=None, lockpath=None, capacity=0.0, **kwargs)

Start a job on the device.

The function first translates the payload into an instrument-specific language, using the capacity provided if necessary. The converted payload is then submitted to the device, overwriting any current job information.

Parameters
  • address (str) – IP address of the potentiostat.

  • channel (int) – Numeric, 1-indexed ID of the channel.

  • dllpath (Optional[str]) – Path to the BioLogic DLL file.

  • payload (list[dict]) – A protocol describing the techniques to be executed and their order.

  • capacity (float) – The capacity information for the studied battery cell. Only required for battery-testing applications or for payloads where currents are specified using C or D rates.

Returns

A timestamp corresponding to the start of the job execution.

Return type

timestamp

tomato.drivers.biologic.main.stop_job(address, channel, jobqueue, logger, dllpath=None, lockpath=None, **kwargs)

Stop a job running on the device.

This function stops any currently running technique on the specified channel of the device. No data is returned.

Parameters
  • address (str) – IP address of the potentiostat.

  • channel (int) – Numeric, 1-indexed ID of the channel.

  • dllpath (Optional[str]) – Path to the BioLogic DLL file.

Returns

A timestamp corresponding to the start of the job execution.

Return type

timestamp