Skip to main content

BenHW SDK - Python Interface

Python interface for Bentham Instruments Hardware Control DLL.

Installation

pip install benhw

Usage

Example

from benhw import BenHW, exceptions, tokens

hw = BenHW()

try:
  hw.build_system_model("system.cfg")
  hw.load_setup("setup.atr")
  hw.initialise()
  hw.park()
  hw.select_wavelength(wl=555)
  hw.set("motor1", tokens.MotorPosition, 0, 4455)
  signal = hw.automeasure()
  print(f"signal: {signal}")
except exceptions.BenHWException as e:
  print(f"BenHW error: {e}")

Accessing Tokens and Errors

from benhw import tokens, errors

# Access tokens via namespace
print(tokens.ADCVolts)           # 504
print(tokens.MonochromatorCurrentWL)  # 11

# Access error codes via namespace
print(errors.BI_OK)      # 0
print(errors.BI_error)   # -1

Requirements

  • Python 3.12+
  • Windows operating system

Download files

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

Source Distribution

benhw-0.8.0.tar.gz (2.2 MB view details)

Uploaded Source

Built Distribution

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

benhw-0.8.0-py3-none-any.whl (2.2 MB view details)

Uploaded Python 3

File details

Details for the file benhw-0.8.0.tar.gz.

File metadata

  • Download URL: benhw-0.8.0.tar.gz
  • Upload date:
  • Size: 2.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for benhw-0.8.0.tar.gz
Algorithm Hash digest
SHA256 1e02c21d7ae5fa00db9f16ee1d05270aa1f4facc5b0944a15dcd16ebb36ef5e3
MD5 573b151c02f18a383715528b1db5fb49
BLAKE2b-256 0364d7bb99bdf8c1e656161fd2751e69435416fbe773cc95d97857233b4f7ac8

See more details on using hashes here.

File details

Details for the file benhw-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: benhw-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for benhw-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6dc38e23cd32b77821cbc7c1cf62db9818286139dd684e081241edef55f4d03b
MD5 a66e1c30eb45e86aa7204b68c5144ff1
BLAKE2b-256 9321a9d30b6990c660a729d7d1cb77175456508553ef65fb301b9b6c288e2917

See more details on using hashes here.

Release history Release notifications | RSS feed

0.9.0

2 files

This release

0.8.0 This release

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.0

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