Skip to main content

tcp-modbus-aio

PyPI version

asyncio client library for tcp modbus devices. built on top of umodbus but extended for more industrial robustness and asyncio compat. the umodbus documentation is recommended reading to have any hope of using this code.

narrowly constructed for the use cases of Tutor Intelligence, but feel free to post an issue or PR if relevant to you.

usage

create a TCPModbusClient. once you have it, you can call the following methods on it:

  • await conn.send_modbus_message(request_function, **kwargs): sends a umodbus.functions.ModbusFunction to the modbus device and returns the corresponding ModbusFunction reply.
  • await conn.test_connection(): sends a modbus message to the device to ensure it's still operational (currently hardcoded to read coil 0) and return boolean of whether it succeeded. is implemented as a cached awaitable to allow you to spam this call.
  • await conn.clear_tcp_connection(): kill the current TCP socket (a new one will automatically be created for the next request)
  • await conn.log_watch(msg, memo_key="system_temperature", expiry_period_s=10, hz=1): spins up a background coroutine to log the result of that message for the next expiry_period seconds at hz frequency. memo_key is used to allow multiple calls to log_watch without having overlapping log watch loops.
  • await conn.close(): for cleaning up the connection (kills TCP conn and ping loop)

Download files

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

Source Distribution

tcp_modbus_aio-0.4.8.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

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

tcp_modbus_aio-0.4.8-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file tcp_modbus_aio-0.4.8.tar.gz.

File metadata

  • Download URL: tcp_modbus_aio-0.4.8.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tcp_modbus_aio-0.4.8.tar.gz
Algorithm Hash digest
SHA256 1f3de1a57ff1e66f6d571d4f51e59238fadb45ad0406718e812ef63b7c8995b1
MD5 a32aec2b7b5f54215c94e64768720660
BLAKE2b-256 cb35836712d44a0393d08579aa2f38b4b0d3da92a2d90525d7af0af77c8cb776

See more details on using hashes here.

Provenance

The following attestation bundles were made for tcp_modbus_aio-0.4.8.tar.gz:

Publisher: cd.yml on tutorintelligence/tcp-modbus-aio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tcp_modbus_aio-0.4.8-py3-none-any.whl.

File metadata

  • Download URL: tcp_modbus_aio-0.4.8-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for tcp_modbus_aio-0.4.8-py3-none-any.whl
Algorithm Hash digest
SHA256 7c051d508a02fc17adcb0870f59d5b2fb2d3eace69d0efed38829e96fe5465dd
MD5 e96258b694fca9053e86aa00a0764506
BLAKE2b-256 c19700b43748d714850ed10b9d26224206139176c5ad90be109ec5e6e2559633

See more details on using hashes here.

Provenance

The following attestation bundles were made for tcp_modbus_aio-0.4.8-py3-none-any.whl:

Publisher: cd.yml on tutorintelligence/tcp-modbus-aio

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.8 This release

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.0

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.1

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