Skip to main content

scietex.hal.vfd

The scietex.hal.vfd package is a Python library for interfacing with variable frequency drives (VFD). It defines a transport-agnostic driver contract (VFDProtocol) plus the data structures and capability model shared by every driver, and ships concrete implementations for three drive families.

A driver reaches a drive over one of two transports:

  • Direct RS485 — the driver owns the serial port and speaks Modbus RTU to the drive itself (scietex.hal.vfd.base.rs485.VFD).
  • Scietex Modbus gateway — the gateway owns the RS485 bus, and the driver speaks Modbus/TCP to a gateway device entry that routes to the drive by unit id (scietex.hal.vfd.intek.spe_b.client.IntekSPEBModbusVFD).

Features

  • VFDProtocol, a runtime-checkable contract: connect, disconnect, read parameters, read state, read and reset faults, start, stop and set the frequency setpoint.
  • VFDCapabilities, which advertises optional control surface (direction, jog, freewheel stop, fault reset, frequency setpoint) so a caller can reject an unsupported command before dispatching it.
  • VFDParameters, which reports frequency in both Hz and percent of the configured maximum, plus output current, voltage and power, and the optional DC bus voltage and temperatures a drive exposes. An optional field is None when the drive does not report it, which is distinct from a reported 0.0.
  • Implemented drive models, each with both transports:
    • Intek SPE-B — direct RS485 (SPEvB) and gateway (IntekSPEBModbusVFD).
    • Vesper E5-8200 — direct RS485 (VesperE58200) and gateway (VesperE58200ModbusVFD).
    • Vesper E4-8400 / E4-P8402 — direct RS485 (VesperE48400) and gateway (VesperE48400ModbusVFD).
  • Driver descriptors for the gateway (scietex.modbus.drivers entry-point group) and driver classes for a service (scietex.hal.vfd.drivers group).

What each drive reports

Field Intek SPE-B Vesper E5-8200 Vesper E4-8400
frequency_hz yes yes yes
frequency_percent yes yes yes
output_current yes yes yes
output_voltage yes yes yes
output_power yes no (0.0) no (0.0)
dc_bus_voltage yes yes yes
heatsink_temperature_c no (None) no (None) yes
motor_temperature_c no (None) no (None) no (None)

Only the E4-8400 exposes a live temperature reading (004Dh, U1-46). The other two report overheat only as a fault code, and a fault is not a temperature.

Installation

Install the package via pip (assuming it's published to PyPI):

pip install scietex.hal.vfd

Alternatively, clone the repository and install locally:

git clone https://github.com/bond-anton/scietex.hal.vfd.git
cd scietex.hal.vfd
pip install .

Requirements

  • Python 3.10 or higher.
  • scietex.hal.serial 2.4 or newer (RS485 transport and Modbus gateway descriptors).
  • pymodbus 3.15 or newer (Modbus/TCP client for the gateway transport).

Usage

Every driver implements VFDProtocol: connect, close, read_data, read_parameters, read_state, read_error_code, clear_error, start, stop and set_frequency. Check driver.capabilities before issuing an optional command.

Direct RS485 with the Intek SPE-B VFD:

import asyncio

from scietex.hal.serial import ModbusSerialConnectionConfig
from scietex.hal.vfd.intek import SPEvB


async def main(serial_conf: ModbusSerialConnectionConfig):
    """Main function."""
    vfd = SPEvB(serial_conf, address=1, label="Intek VFD")
    data = await vfd.read_data()
    print(data)


if __name__ == "__main__":
    serial_configuration = ModbusSerialConnectionConfig(
        port="/dev/serial0", baudrate=19200
    )
    asyncio.run(main(serial_configuration))

The same drive behind the Scietex Modbus gateway:

import asyncio

from scietex.hal.vfd.intek import IntekSPEBModbusVFD


async def main():
    """Main function."""
    vfd = IntekSPEBModbusVFD("gateway.local", port=502, unit_id=1)
    await vfd.connect()
    try:
        print(await vfd.read_data())
        print(await vfd.read_error_code())
    finally:
        await vfd.close()


if __name__ == "__main__":
    asyncio.run(main())

A Vesper drive behind the gateway works the same way:

from scietex.hal.vfd.vesper import VesperE48400ModbusVFD

vfd = VesperE48400ModbusVFD("gateway.local", port=502, unit_id=1)

set_frequency takes Hz, not percent: the caller works in engineering units and each driver converts with its own maximum-frequency parameter. The E5-8200's communication manual names no maximum-frequency parameter, so its driver takes max_frequency_hz from the constructor (default 50.0, the factory base frequency); a caller whose drive runs a different maximum must pass it, or frequency_percent will be wrong.

A drive that has never been configured for the gateway answers neither transport. See the per-family references for the register maps, the fault tables and the settings the gateway requires:

Contributing

Contributions are welcome! To contribute:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/YourFeature).
  3. Commit your changes (git commit -m "Add your message").
  4. Push to the branch (git push origin feature/YourFeature).
  5. Open a Pull Request.

Run the checks before opening a pull request:

tox -e format,lint,type,test

format and lint run ruff, type runs ty, and test runs pytest across Python 3.10, 3.12 and 3.14.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Metadata

Release files for scietex.hal.vfd 2.0.1

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

Source distribution (sdist)

Source distribution for scietex.hal.vfd 2.0.1
File Size Uploaded Provenance Actions
scietex_hal_vfd-2.0.1.tar.gz 49.3 kB With provenance Details for scietex_hal_vfd-2.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for scietex.hal.vfd 2.0.1
File Interpreter ABI Platform Actions
scietex_hal_vfd-2.0.1-py3-none-any.whl Python 3 none any Details for scietex_hal_vfd-2.0.1-py3-none-any.whl

Total release size: 103.1 kB

Release files / scietex_hal_vfd-2.0.1.tar.gz

Download URL scietex_hal_vfd-2.0.1.tar.gz
Size 49.3 kB
Tags Source
SHA-256 checksum
How to use checksums
408ba112ef1554e22de60908ade5792317f0a9ead7946dbb2f5c1079d1a5ffcb
BLAKE2b-256 checksum
How to use checksums
9416de0a7914aac86752026c7f2710c05131424119628a302f817d20b353b351
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / scietex_hal_vfd-2.0.1-py3-none-any.whl

Download URL scietex_hal_vfd-2.0.1-py3-none-any.whl
Size 53.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3e409b94a486c18b50d7f5ded078a998f17fa10659734e40e4cbafce382bb280
BLAKE2b-256 checksum
How to use checksums
a011053b2c4bef10220b35969b00609e3dec5025a2ee3679145d3b627044aa8f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for scietex.hal.vfd 2.0.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for scietex_hal_vfd-2.0.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

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