Getting Started
Start Here
Use this package when you want the shortest Python path to TOYOPUC Computer Link communication through the public high-level API.
Recommended first path:
- Install
toyopuc-computerlink. - Choose the correct profile for your target.
- Open one client and read
P1-D0000. - Write only to a known-safe test word or bit after the first read is stable.
First PLC Registers To Try
Start with these first:
P1-D0000P1-D0001P1-M0000P1-D0100:F
Do not start with these:
- relay hops
FRwrites- large chunked reads
Minimal Synchronous Pattern
from toyopuc import ToyopucDeviceClient
with ToyopucDeviceClient("192.168.250.100", 1025) as client:
value = client.read("P1-D0000")
print(value)
Minimal Async Pattern
from toyopuc import ToyopucConnectionOptions, open_and_connect
options = ToyopucConnectionOptions(host="192.168.250.100", port=1025)
If a profile is in use, basic area families should use the correct P1-, P2-, or P3- prefix.
First Successful Run
Recommended order:
client.read("P1-D0000")client.write("P1-D0001", 1234)only on a safe test wordclient.write("P1-M0000", 1)only on a safe test bitread_named(plc, ["P1-D0000", "P1-D0100:F", "P1-D0000.0"])
Common Beginner Checks
If the first read fails, check these in order:
- correct host and port
- correct profile
- correct
P1-,P2-, orP3-prefix - start with
P1-D0000instead ofFRor relay addresses