Python

This documentation is for version 26.5.33 of the module.

The zahner_link Python library provides comprehensive programmatic control of the Zahner IM7/c/x Electrochemical Workstations. Built on an efficient C++ foundation, this job-based library enables you to automate complex measurement protocols and integrate electrochemical experiments into your data analysis workflows.

What makes this library particularly powerful is that it uses the exact same C++ core library as Zahner Lab itself. This means you get identical functionality whether you’re working in the GUI or writing Python code - no feature compromises or compatibility issues to worry about.

Key Features

Job-Based Architecture: Each instrument function is mapped to a specific job that can be executed independently or combined into complex protocols.

High Performance: The library leverages a compiled C++ core for optimal speed and reliability.

Full Instrument Access: Complete programmatic control over all instrument features and measurement parameters.

Python Integration: Seamlessly integrates with popular Python libraries for data analysis and visualization.

Getting Started

The library is built on a simple, job-based architecture and is fully documented to ensure a smooth onboarding experience. To simplify device integration and help you get started quickly, we have provided numerous examples both in this documentation (see Examples) and on GitHub.

LINK TO GITHUB WILL BE ADDED WHEN PUBLISHED

You can easily install the package from PyPI using pip: https://pypi.org/project/zahner-link/

Below, an example demonstrates the elegant simplicity of zahner_link - connecting to your instrument and performing an EIS measurement:

import zahner_link as zl

link = zl.ZahnerLinkExc("localhost", "1994")
link.connect()

switch_on_job = zl.control.SwitchOnJob(
   potentiostat="MAIN:1:POT",
   coupling=zl.PotentiostatCoupling.POTENTIOSTATIC,
   bias=1.0,
   voltage_range_index=0,
   compliance_range_index=0,
)
link.do_job(switch_on_job)

eis_generate_job = zl.meas.EisGenerateJob(
   bias=0,
   min_frequency=10,
   max_frequency=1e5,
   start_frequency=10e3,
   points_per_decade_upper=8,
   points_per_decade_lower=5,
   pre_duration=0.1,
   pre_waves=1,
   meas_duration=1,
   meas_waves=4,
   amplitude=1e-2,
)
link.do_job(eis_generate_job)
eis_data = link.get_job_result_data(eis_generate_job)

switch_off_job = zl.control.SwitchOffJob(potentiostat="MAIN:1:POT")
link.do_job(switch_off_job)

link.disconnect()

Applications

The zahner_link library enables a wide range of electrochemical applications:

Research Automation: Develop automated measurement sequences for systematic studies and parameter optimization.

Data Integration: Connect electrochemical measurements directly with analysis tools like pandas, numpy, and matplotlib.

Custom Protocols: Design specialized measurement procedures tailored to your specific research requirements.

High-Throughput Testing: Implement automated testing workflows for battery characterization, corrosion studies, and material evaluation.

Adaptive Measurements: Use real-time feedback and stop conditions to create responsive experimental protocols.

API Documentation

Complete documentation for all available jobs and functions:

Examples

There is a Jupyter notebook for each example, which explains the example code in detail.

BasicIntroduction.ipynb provides the most basic introduction and describes the connection setup in detail.

The notebooks should be viewed in the order they are listed, as some build on each other and not all explanations are repeated.

The zahner_link library also includes third-party software components. The licenses for these components can be found in the zahner_link/third_party_licenses directory of the installed package.