asyncio client library for tcp modbus devices
Project description
tcp-modbus-aio
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 aumodbus.functions.ModbusFunctionto the modbus device and returns the correspondingModbusFunctionreply.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 nextexpiry_periodseconds athzfrequency.memo_keyis used to allow multiple calls tolog_watchwithout having overlapping log watch loops.await conn.close(): for cleaning up the connection (kills TCP conn and ping loop)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tcp_modbus_aio-0.4.7.tar.gz.
File metadata
- Download URL: tcp_modbus_aio-0.4.7.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6de830a957c9c2c26c06b07cce91f8912866b003ed24b2c27a61efaf27186520
|
|
| MD5 |
64509671891332d027597093745a0c8c
|
|
| BLAKE2b-256 |
7fc18ac8339475afc89dac22f2547f391b73481aebb38905136433735c508727
|
Provenance
The following attestation bundles were made for tcp_modbus_aio-0.4.7.tar.gz:
Publisher:
cd.yml on tutorintelligence/tcp-modbus-aio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tcp_modbus_aio-0.4.7.tar.gz -
Subject digest:
6de830a957c9c2c26c06b07cce91f8912866b003ed24b2c27a61efaf27186520 - Sigstore transparency entry: 630282163
- Sigstore integration time:
-
Permalink:
tutorintelligence/tcp-modbus-aio@f8c7681b8f08d9379af7de307b42f79f3732c716 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tutorintelligence
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@f8c7681b8f08d9379af7de307b42f79f3732c716 -
Trigger Event:
push
-
Statement type:
File details
Details for the file tcp_modbus_aio-0.4.7-py3-none-any.whl.
File metadata
- Download URL: tcp_modbus_aio-0.4.7-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9eb902dc7468507c5f25b7e3a5d0a8e77adc120df7b3c258670d5899de7699a1
|
|
| MD5 |
ce87de78989a861ea8311f7b5156f485
|
|
| BLAKE2b-256 |
1a93b97501ab3b0d252557c8451886aeebca6bead692b3042924f2be53716fc5
|
Provenance
The following attestation bundles were made for tcp_modbus_aio-0.4.7-py3-none-any.whl:
Publisher:
cd.yml on tutorintelligence/tcp-modbus-aio
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tcp_modbus_aio-0.4.7-py3-none-any.whl -
Subject digest:
9eb902dc7468507c5f25b7e3a5d0a8e77adc120df7b3c258670d5899de7699a1 - Sigstore transparency entry: 630282166
- Sigstore integration time:
-
Permalink:
tutorintelligence/tcp-modbus-aio@f8c7681b8f08d9379af7de307b42f79f3732c716 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/tutorintelligence
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
cd.yml@f8c7681b8f08d9379af7de307b42f79f3732c716 -
Trigger Event:
push
-
Statement type: