Skip to main content

Python API for Biologic EC-lab potentiostats

Project description

aurora-biologic logo aurora-biologic logo


Overview

aurora-biologic provides a standalone Python API and command line interface (CLI) to control Biologic cyclers.

It is designed and tested on MPG2 cyclers using EC-lab 11.52 and 11.61.

Features

  • CLI and Python API
  • Connect to EC-lab cyclers
  • Retrieve status of channels
  • Load protocols onto channels
  • Start and stop experiments

For parsing binary data from Biologic, we recommend yadg.

Installation

Install on a Windows PC with EC-lab >11.52 installed.

[!IMPORTANT] EC-lab must have OLE/COM activated

OLE/COM is a Windows interface for programs to expose their functionality to third-parties, which is supported by EC-lab.

Open a terminal as administrator, go to your folder containing EClab.exe and register the server:

cmd

cd "C:/Program files (x86)/EC-lab"
eclab \regserver

powershell

cd "C:/Program files (x86)/EC-lab"
.\eclab \\regserver

You can also deregister in the same way with /unregserver.

Next, install this package with

pip install aurora-biologic

To see commands, use

biologic --help

The first time you run the command line, a config file is generated at:

C:\Users\<user>\AppData\Local\aurora-biologic\aurora-biologic\config.json

which will look like:

{
    "serial_to_name": {
        "12345": "MPG2-1",
        "12346": "MPG2-2"
    },
    "eclab_path": "C:/Program Files (x86)/EC-Lab/EClab.exe"
}

Rename your devices according to their serial number, and make sure the EC-lab executable path is correct and the same as the executable registered in the first step.

CLI usage

Make sure EC-lab is running.

You can check what devices and channels were found with

biologic pipelines

The pipeline ID is made up of the {device name}-{channel index}, such as MPG2-1-7

These IDs are used for other functions, for example to see the status of that channel use

biologic status MPG2-1-7

[!TIP] See all commands with biologic --help.

See details of a command with biologic [command] --help e.g. biologic status --help.

API usage

Commands can also be run using Python.

Make sure EC-lab is running.

Then commands can be run using the BiologicAPI object

from aurora_biologic import BiologicAPI
with BiologicAPI() as bio:
    bio.start(
        "my_pipeline_id",
        "path/to/my_experiment.mps",
        "path/to/an/output.mpr",
    )

Using commands over SSH

[!WARNING] OLE/COM requires an interactive session to function.

Standard command line functions will not work in non-interactive session, such as normal SSH from a terminal.

To use the CLI over SSH you must start a listener daemon in an interactive terminal.

On the PC with EC-lab, start the listener with:

biologic daemon

Then from the SSH session use normal CLI commands with the --ssh option, e.g.

biologic status --ssh

Instead of trying to run OLE/COM commands directly in the non-interactive session, it will send commands to the daemon, which will execute and reply.

Contributors

Acknowledgements

Special thanks to Julian Diener from Biologic for their advice and support.

This software was developed at the Laboratory of Materials for Energy Conversion at Empa, the Swiss Federal Laboratories for Materials Science and Technology, and supported by funding from the IntelLiGent project from the European Union’s research and innovation program under grant agreement No. 101069765, and from the Swiss State Secretariat for Education, Research, and Innovation (SERI) under contract No. 22.001422.

IntelLiGent logo IntelLiGent logo     EU flag     Swiss secretariat

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aurora_biologic-0.2.2.tar.gz (15.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aurora_biologic-0.2.2-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file aurora_biologic-0.2.2.tar.gz.

File metadata

  • Download URL: aurora_biologic-0.2.2.tar.gz
  • Upload date:
  • Size: 15.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.4

File hashes

Hashes for aurora_biologic-0.2.2.tar.gz
Algorithm Hash digest
SHA256 873b7452abd0359dad0cec916cebb75fd8772c429f1e6f9e9e5103d8cdecd32e
MD5 1c0082546582349be45e54b93bc8edf2
BLAKE2b-256 6c4764baa15fde960fff4355f23e6b76a1a88adccfa70035a83bf4cc5384a8d8

See more details on using hashes here.

File details

Details for the file aurora_biologic-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for aurora_biologic-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 20b4c57b860dd61e2667759551d66d6040a334d7f670d82385b30c5fe692004f
MD5 b3c81d782a0055150621de6e1569e6b8
BLAKE2b-256 126f96500c0ac975fa96646dc4af0b5e89de1de34ed7dea635110ce4310cc18c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page