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

License

Licensed under the MIT License (SPDX: MIT). Copyright (c) 2026 Bentham Instruments Ltd. SPDX-License-Identifier: MIT

See the LICENSE file included in this package. Third-party components are listed in THIRD_PARTY_NOTICES.txt.

Metadata

Release files for benhw 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for benhw 1.1.0
File Size Uploaded Provenance Actions
benhw-1.1.0.tar.gz 2.2 MB Without provenance Details for benhw-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for benhw 1.1.0
File Interpreter ABI Platform Actions
benhw-1.1.0-py3-none-any.whl Python 3 none any Details for benhw-1.1.0-py3-none-any.whl

Total release size: 4.4 MB

Release files / benhw-1.1.0.tar.gz

Download URL benhw-1.1.0.tar.gz
Size 2.2 MB
Tags Source
SHA-256 checksum
How to use checksums
a8a83017722d103ec12e47ac7ec1a211f54b5a751abc50fc1925475640e16fa8
BLAKE2b-256 checksum
How to use checksums
9213adc0b2664d8cc40cb5f9317af3f8a826f548998a09861fd976c950a84dc8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / benhw-1.1.0-py3-none-any.whl

Download URL benhw-1.1.0-py3-none-any.whl
Size 2.2 MB
Tags Python 3
SHA-256 checksum
How to use checksums
5ee836a962236cc13a9674dafc1c4e4ba7c6af471d6367fe1b3845202faa48ea
BLAKE2b-256 checksum
How to use checksums
ca80780ae3b4fdbc961055ba4f540b5892c1b816acad628a3700ecfbc1d0b8f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for benhw 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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