Skip to content
/ df1x Public

Foundational, cross-platform Python implementation of Allen-Bradley DF1 / PCCC over serial.

License

Notifications You must be signed in to change notification settings

Hugefan0/df1x

Repository files navigation

df1x

Advanced DF1 / PCCC client for Allen-Bradley SLC / MicroLogix over serial.

Layout

  • df1x/ – library package
  • examples/ – usage examples

Quick start

pip install pyserial
from 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()

Installation

For now, install from source (editable):

python3 -m pip install -U pip
python3 -m pip install -e .

Quick start

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)

Status

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.

License

MIT (see LICENSE).

Acknowledgments

This library was created by Matthew McKinney with extensive conceptual, debugging, and engineering assistance from an AI technical partner. ⧉⋇⟟

About

Foundational, cross-platform Python implementation of Allen-Bradley DF1 / PCCC over serial.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages