Skip to main content

Library to control Zahner IM7 potentiostats

Project description

zahner_link

PyPI version Python versions Documentation License

The zahner_link library provides comprehensive programmatic control of the Zahner IM7/c/x Electrochemical Workstations. Available for both Python and C++, 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 code, no feature compromises or compatibility issues to worry about.

📚 Documentation

The complete documentation is available on the API documentation website, including:

  • A detailed reference for every job, class, and function
  • Dedicated sections for the Python and C++ APIs
  • The examples from this repository, rendered for online browsing

✨ Features

  • Job-based API - build measurements from composable jobs instead of low-level commands
  • Identical core to Zahner Lab - uses the exact same C++ core library as the GUI, so results and capabilities match
  • Python and C++ - the same API available as a Python package and a C++ library
  • Cross-platform - pre-built wheels for Windows, Linux (glibc/musl), and macOS

Measurement Techniques

  • Electrochemical Impedance Spectroscopy (auto-generated or custom frequency tables)
  • Potentiostatic and galvanostatic polarization
  • Pulse voltammetry (NPV, DPV, SWV)
  • Current-voltage curves (e.g. Cyclic Voltammetry)
  • Measurements with arbitrary, freely defined excitation signals

Data and Control

  • Live DC and EIS data via callbacks
  • Stop conditions to extend measurement primitives
  • Access to raw EIS waveform data
  • Export to Zahner XML (.zmx), directly openable in Zahner Analysis
  • Exception-based and return-value-based API variants with connection-loss recovery

Supported Hardware

  • IM7/c/x Electrochemical Workstations
  • Extension cards: PAD42, TEMP-U2, RMUX16, MIO, EPC42

🔧 Installation

The package can be installed via pip.

pip install zahner_link

✅ Requirements

  • Python 3.11 or later

Pre-built wheels are available for:

  • Windows: x86_64
  • Linux: x86_64 and ARM64 (glibc and musl)
  • macOS: ARM64

🔨 Basic Usage

The Jupyter notebook BasicIntroduction.ipynb explains the fundamentals of using the library. The equivalent C++ example is available in cpp/BasicIntroduction/main.cpp.

import zahner_link as zl

"""
Connect to the Zahner IM7 via its IP address and port.
"""
link = zl.ZahnerLinkExc("10.10.253.150", "1994")
link.connect()

"""
Switch on the main potentiostat in potentiostatic mode at 1 V DC.
All values use SI base units (volts, amperes, seconds).
"""
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 measurement at 1 V DC with 10 mV amplitude.
The frequency points are generated automatically from start_frequency
up to max_frequency, then down to min_frequency.
"""
eis_generate_job = zl.meas.EisGenerateJob(
    bias=1.0,
    min_frequency=10,
    max_frequency=1e5,
    start_frequency=10e3,
    points_per_decade_upper=8,
    points_per_decade_lower=5,
    pre_duration=0,
    pre_waves=1,
    meas_duration=0.1,
    meas_waves=4,
    amplitude=10e-3,
)
link.do_job(eis_generate_job)

"""
Read out the measured frequency and complex impedance.
"""
eis_generate_data = link.get_job_result_data(eis_generate_job)
print("Frequency: " + str(eis_generate_data.get_frequencies()))
print("Impedance: " + str(eis_generate_data.get_impedance_data().get_calculated_complex_impedance_track()))

"""
Export the measurement to Zahner XML format, which can be opened in Zahner Analysis.
"""
xml_measurement = zl.xml.Measurement(eis_generate_data)
exporter = zl.xml.ZXmlExporter()
exporter.set_compact_xml(False)
exporter.save_as_file_standalone(xml_measurement, "eis_generate_job.zmx")

"""
Switch off the potentiostat and disconnect.
"""
link.do_job(zl.control.SwitchOffJob(potentiostat="MAIN:1:POT"))
link.disconnect()

📖 Examples

The examples are part of this repository as Jupyter notebooks under python/ and are also rendered in the documentation.

Example Description
BasicIntroduction First steps: connecting, DC calibration, switching on, a simple measurement and data export
Polarizations Potentiostatic and galvanostatic polarization measurements and data handling
Eis Electrochemical Impedance Spectroscopy with generated and custom frequency tables
PulseVoltammetry Pulse voltammetry techniques (NPV, DPV, SWV)
CurrentVoltageCurves Recording current-voltage curves such as cyclic voltammetry
CurrentDependentCharacterization Characterizing a device as a function of the DC bias current
ArbitrarySignal Measurements with arbitrary, freely defined excitation signals
EisWaves Accessing and visualizing the raw EIS waveform data
StopConditions Extending measurement primitives with stop conditions
LiveDataCallbacks Receiving live DC and EIS data through callbacks
ChannelConfiguration Advanced channel configuration, including PAD4 cards
TempuRmuxMio Using the TEMP-U2, RMUX16, and MIO extension cards
ErrorHandling Error handling, connection loss recovery, and job inspection

📧 Having a question?

Send a mail to our support team.

⁉️ Found a bug or missing a specific feature?

Feel free to create a new issue with an appropriate title and description in the zahner_link repository issue tracker. Or send a mail to our support team.

⚖️ License

The zahner_link library is licensed under the Zahner Software License.

This project 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.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

zahner_link-26.26.0-cp314-cp314t-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.14tWindows x86-64

zahner_link-26.26.0-cp314-cp314t-musllinux_1_2_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

zahner_link-26.26.0-cp314-cp314t-musllinux_1_2_aarch64.whl (6.8 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

zahner_link-26.26.0-cp314-cp314t-manylinux_2_34_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.34+ x86-64

zahner_link-26.26.0-cp314-cp314t-manylinux_2_34_aarch64.whl (5.7 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.34+ ARM64

zahner_link-26.26.0-cp314-cp314-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.14Windows x86-64

zahner_link-26.26.0-cp314-cp314-musllinux_1_2_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

zahner_link-26.26.0-cp314-cp314-musllinux_1_2_aarch64.whl (6.8 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ ARM64

zahner_link-26.26.0-cp314-cp314-manylinux_2_34_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ x86-64

zahner_link-26.26.0-cp314-cp314-manylinux_2_34_aarch64.whl (5.7 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.34+ ARM64

zahner_link-26.26.0-cp314-cp314-macosx_26_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.14macOS 26.0+ ARM64

zahner_link-26.26.0-cp313-cp313-win_amd64.whl (3.7 MB view details)

Uploaded CPython 3.13Windows x86-64

zahner_link-26.26.0-cp313-cp313-musllinux_1_2_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

zahner_link-26.26.0-cp313-cp313-musllinux_1_2_aarch64.whl (6.8 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ ARM64

zahner_link-26.26.0-cp313-cp313-manylinux_2_34_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

zahner_link-26.26.0-cp313-cp313-manylinux_2_34_aarch64.whl (5.7 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ ARM64

zahner_link-26.26.0-cp313-cp313-macosx_26_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.13macOS 26.0+ ARM64

zahner_link-26.26.0-cp312-cp312-win_amd64.whl (3.7 MB view details)

Uploaded CPython 3.12Windows x86-64

zahner_link-26.26.0-cp312-cp312-musllinux_1_2_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

zahner_link-26.26.0-cp312-cp312-musllinux_1_2_aarch64.whl (6.8 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ ARM64

zahner_link-26.26.0-cp312-cp312-manylinux_2_34_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

zahner_link-26.26.0-cp312-cp312-manylinux_2_34_aarch64.whl (5.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ ARM64

zahner_link-26.26.0-cp312-cp312-macosx_26_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.12macOS 26.0+ ARM64

zahner_link-26.26.0-cp311-cp311-win_amd64.whl (3.7 MB view details)

Uploaded CPython 3.11Windows x86-64

zahner_link-26.26.0-cp311-cp311-musllinux_1_2_x86_64.whl (6.8 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

zahner_link-26.26.0-cp311-cp311-musllinux_1_2_aarch64.whl (6.8 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ ARM64

zahner_link-26.26.0-cp311-cp311-manylinux_2_34_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

zahner_link-26.26.0-cp311-cp311-manylinux_2_34_aarch64.whl (5.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ ARM64

zahner_link-26.26.0-cp311-cp311-macosx_26_0_arm64.whl (5.2 MB view details)

Uploaded CPython 3.11macOS 26.0+ ARM64

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