Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Easy Biologic

Allows easy control over BioLogic devices. High and low level control over BioLogic devices are available. Low level control is in the lib subpackage, while high level control is in the main module.

Install with python -m pip install easy-biologic

API

For a full overview of both APIs see API.md.

High Level

High level control of devices and programs. Most users will use these.

  • Biologic Device: Represents a BioLogic Device.
  • Biologic Program: Represents a program to be run on a device.
  • Program Runner: Represents a program to be run on a device channel.
  • Base Programs: Basic implementations of BiologicPrograms.
  • Find Devices: A convenience script for finding connected devices.

Low Level

Gives direct control of the Biologic device using DLL libraries. Used to implement new techniques.

  • EC Lib: Contains methods converting the BL_* DLL functions for use, enumeration classes to encapsulate program and device states, and C Structures for sending and receiving data from th device.
  • Data Parser: Parses data received from a technique and contains technique fields for different device types.
  • EC Find: Implements the BL Find DLL.
  • Technique Fields: Parameter types for techniques. (Not all techniques are implemented.)
  • EC Errors: Implements EC errors.

Examples

Basic

Runs an MPP program on channels 0 - 7 for 10 minutes.

import easy_biologic as ebl
import easy_biologic.base_programs as blp

# create device
bl = ebl.BiologicDevice('192.168.1.2')

# create mpp program
params = {
	'run_time': 10* 60		
}

mpp = blp.MPP(
    bl,
    params, 	
    channels = [ 0, 1, 2, 3, 4, 5, 6 ]        
)

# run program
mpp.run('data')

Custom parameters

Runs a CV scan for three cycles at a scan rate of 50 mV/s on channel 0. The experiment begins at 0.5 V and forward scans to -0.25 V, then scans backward to 0.8 V. In the final cycle, it scans to 1.0 V.

import easy_biologic as ebl
import easy_biologic.base_programs as blp        

bl = ebl.BiologicDevice('192.168.1.2')
save_path = '/path/to/data/CV.csv'
params = {
    'start': 0.5,
    'end': -0.25,
    'E2': 0.8,
    'Ef': 1.0,
    'rate': 0.05,  
    'step': 0.001,    
    'N_Cycles': 2,
    'begin_measuring_I': 0.5,
    'End_measuring_I': 1.0,
}  

CV = blp.CV(
    bl,
    params,     
    channels = [0]
)     

CV.run('data')
CV.save_data(save_path)

Advanced

Runs an OCV then uses the final OCV voltage for PEIS.

import easy_biologic as ebl
import easy_biologic.base_programs as blp        

bl = ebl.BiologicDevice('192.168.1.2')
save_path_ocv = '/path/to/data/OCV.csv'

# Run OCV
params_ocv = {
    'time': 2,
    'time_interval': 1,
}

ocv = blp.OCV(
    bl,
    params_ocv,
    channels=[0]
)

ocv.run('data')
ocv.save_data(save_path_ocv)

voc = {
    ch: [datum.voltage for datum in data]
    for ch, data in ocv.data.items()
}

voc = {
    ch: sum(ch_voc) / len(ch_voc)
    for ch, ch_voc in voc.items()
}

# Run PEIS
save_path_peis = '/path/to/data/PEIS.csv'
params_peis = {
    'voltage': list(voc.values())[0],
    'final_frequency': 1000,
    'initial_frequency': 1000000,
    'amplitude_voltage': 0.1,
    'frequency_number': 60,
    'duration': 0,
    'repeat': 10,
    'wait': 0.1
}

peis = blp.PEIS(
    bl,
    params_peis,
    channels=[0]
)

peis.run('data')
peis.save_data(save_path_peis)

Extras

  • pandas: Use pandas to save data.

Known issues

  • USB connection: Often times using a USB connection will give a ERR_COMM_CONNECTIONFAILED (-201) error. We have found that USB can be unreliable, and a TCP connection is resolves this issue.

Adding techniques

BioLogic will often update their firmware which needs to be included in this package. To do so 0. Download this package. The easiest way to do this is git clone https://github.com/bicarlsen/easy-biologic.git.

  1. Download the EC-Lab Developer Package, noting its install path (typically C:\EC-Lab Development Package).
  2. Copy the EC-Lab Development Package\lib folder (typically C:\EC-Lab Development Package\lib) into the folder easy-biologic/src/techniques folder and rename it with the major and minor version of the firmware (e.g. 6.04). You can view previous technique version folders for examples.
  3. Update the src/data/techniques_version.json file to the version you just added.
  4. (optional) Create a pull request to have it included in the package, so everybody benefits :).

Download files

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

Source Distribution

easy_biologic-0.5.0rc0.tar.gz (34.1 MB view details)

Uploaded Source

Built Distribution

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

easy_biologic-0.5.0rc0-py3-none-any.whl (46.0 kB view details)

Uploaded Python 3

File details

Details for the file easy_biologic-0.5.0rc0.tar.gz.

File metadata

  • Download URL: easy_biologic-0.5.0rc0.tar.gz
  • Upload date:
  • Size: 34.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.28.1

File hashes

Hashes for easy_biologic-0.5.0rc0.tar.gz
Algorithm Hash digest
SHA256 ffbacf5009bd85c2f38883c584267238b12be79f0165d9c38eda4b7d2e76766d
MD5 88ee6517f232250193163fc4737cc548
BLAKE2b-256 df7d12474c66ce9536de6e0ad2ae793d285af3bfe590f28df0143735c52fe299

See more details on using hashes here.

File details

Details for the file easy_biologic-0.5.0rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for easy_biologic-0.5.0rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f267fb0c551560efd21a0f93255f042efd6fe4937e9491a839a893e32ba0601
MD5 8592d2a4d9990a7999a2c1cba6276628
BLAKE2b-256 cb9168e3ce3c745bacdea80b0a5d3fd487b476b9221361a353e66b455e3f1faf

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.5.0rc0 This release

2 files

0.4.0

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0.post1

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

0.1.0

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page