Advanced DF1 / PCCC client for Allen-Bradley SLC / MicroLogix over serial.
df1x/– library packageexamples/– usage examples
pip install pyserialfrom df1x import Df1Config, SerialTransport, Df1Client
cfg = Df1Config(src=1, dst=1, debug=True, hex_dump=True)
transport = SerialTransport(port="/dev/tty.usbserial-BG00WBKR", config=cfg)
transport.connect()
client = Df1Client(transport=transport, config=cfg)
print("N7:0 =", client.read("N7:0"))
client.write("N7:0", 123)
transport.close()For now, install from source (editable):
python3 -m pip install -U pip
python3 -m pip install -e .Example scripts live alongside the repo (see stress_kitchen_sink.py, etc.). Typical usage:
from df1x import Df1Client, Df1Config
cfg = Df1Config(port="/dev/tty.usbserial-XXXX", baudrate=19200)
with Df1Client(cfg) as plc:
val = plc.read_int("N7:15")
plc.write_int("N7:15", val + 1)This project is actively developed and has been stress-tested on real hardware, but should be treated as beta until broader cross-platform validation and additional PLC coverage are complete.
MIT (see LICENSE).
This library was created by Matthew McKinney with extensive conceptual, debugging, and engineering assistance from an AI technical partner. ⧉⋇⟟