Python client library for TOYOPUC computer-link communication over TCP and UDP
Project description
Computer Link Protocol for Python
A user-focused Python library for JTEKT TOYOPUC Computer Link communication.
The recommended entry points are the high-level ToyopucDeviceClient class and the async helper functions in toyopuc.
For asyncio code, prefer:
ToyopucConnectionOptionsopen_and_connectnormalize_addressparse_device_addresstry_parse_device_addressformat_device_addressread_typedwrite_typedwrite_bit_in_wordread_namedpollread_words_single_requestread_dwords_single_requestread_words_chunkedread_dwords_chunked
Quick Start
Installation
pip install toyopuc-computerlink
Latest release metadata and downloads are available at https://pypi.org/project/toyopuc-computerlink/.
Synchronous Example
from toyopuc import ToyopucDeviceClient
with ToyopucDeviceClient("192.168.250.100", 1025) as client:
value = client.read("P1-D0000")
print(f"P1-D0000 = {value}")
client.write("P1-D0001", 1234)
client.write("P1-M0000", 1)
snapshot = client.read_many(["P1-D0000", "P1-D0001", "P1-M0000"])
print(snapshot)
Asynchronous Example
import asyncio
from toyopuc import ToyopucConnectionOptions, open_and_connect, read_named, read_typed, write_typed
async def main() -> None:
options = ToyopucConnectionOptions(host="192.168.250.100", port=1025, timeout=3.0, retries=0)
async with await open_and_connect(options) as plc:
speed = await read_typed(plc, "P1-D0100", "F")
print(f"speed = {speed}")
await write_typed(plc, "P1-D0200", "L", -500)
values = await read_named(plc, ["P1-D0000", "P1-D0100:F", "P1-D0000.0"])
print(values)
asyncio.run(main())
Basic area families P/K/V/T/C/L/X/Y/M/S/N/R/D require a P1-, P2-, or P3- prefix.
Supported PLC Registers
Start with these public high-level families first:
- prefixed word/register areas:
P1-D0000,P1-S0000,P1-N0100,P1-R0000 - prefixed bit/control areas:
P1-M0000,P1-X0000,P1-Y0000 - extension areas:
ES0000,EN0000 - FR storage:
FR000000 - typed and bit views:
P1-D0100:S,P1-D0200:D,P1-D0300:F,P1-D0000.3
See the full public table in Supported PLC Registers.
Public Docs
- Getting Started
- Supported PLC Registers
- Latest Communication Verification
- User Guide
- Model Ranges
- Sample Guide
Start with these sample programs:
samples/high_level_minimal.pysamples/high_level_basic.pysamples/high_level_all_sync.pysamples/high_level_all_async.pysamples/high_level_udp.py
Maintainer-only notes and retained evidence live under internal_docs/.
Common User Tasks
- normalize one address string:
normalize_address("p1-d0000", profile="TOYOPUC-Plus:Plus Standard mode") - parse one typed address string:
parse_device_address("p1-d0100:f", profile="Generic") - format stored address metadata:
format_device_address(parsed_address) - review model/profile ranges:
ToyopucDeviceCatalog.get_device_matrix("PC10G:PC10 mode") - read or write one device:
client.read("P1-D0000"),client.write("P1-M0000", 1) - read a mixed snapshot:
client.read_many([...])orawait read_named(plc, [...]) - read 32-bit or float values:
client.read_dword(...),client.read_float32(...),await read_typed(..., "D" / "L" / "F") - change one flag bit inside a word:
await write_bit_in_word(plc, "P1-D0100", bit_index=3, value=True) - read contiguous areas with explicit intent:
await read_words_single_request(...),await read_words_chunked(...) - read or write FR storage:
client.read_fr(...),client.write_fr(..., commit=True)
Development & CI
run_ci.bat
release_check.bat
License
Distributed under the MIT License.
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 toyopuc_computerlink-0.1.8.tar.gz.
File metadata
- Download URL: toyopuc_computerlink-0.1.8.tar.gz
- Upload date:
- Size: 55.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
30569537c82bf33b08174fc08ebdbc7897eb00efdee3a2eb5cae12dba347375e
|
|
| MD5 |
e1701ccd3b69c29807b1a2f8b7d7d4d6
|
|
| BLAKE2b-256 |
24279a96473492071a844faf7939199af7f0338b501280cb1c76350cbbb9eefc
|
File details
Details for the file toyopuc_computerlink-0.1.8-py3-none-any.whl.
File metadata
- Download URL: toyopuc_computerlink-0.1.8-py3-none-any.whl
- Upload date:
- Size: 48.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a7736a1749d4c86acd1ef3900aaf134dbe63624e6df14a88914626950f50105
|
|
| MD5 |
087424664e3166e4ae6fde8d4adcb433
|
|
| BLAKE2b-256 |
75b28b846bca059466e987da158bd377a8667c58b70575107a658376461234e8
|