Write ladder logic in Python. Test it. Deploy it to CLICK.
pyrung turns a Python with block into a ladder rung: same rungs, same scan order, same timers as the CLICK PLC, with git, pytest, and a debugger around them.
Same logic, two views
Condition on the rung, instruction in the body. Same scan order as the PLC, so what passes in pytest is what runs in CLICK.
Why
CLICK PLCs ship with no simulator, no version control beyond copies of a .ckp, and no way to test a program short of downloading it to a real PLC. You draw the ladder in CLICK Programming Software, download it to hardware, and hope. The Structured Text crowd has options. The ladder crowd doesn't. pyrung is that option: write and test the logic in Python first, then move the same rungs into CLICK.
Who it's for
Controls engineers who want to test CLICK logic without hardware. Write with plain tag names, map them to X, Y, C, and DS addresses when you're ready, and let the validator tell you what CLICK's memory banks will and won't accept before you find out at the PLC.
Python developers entering industrial automation. pyrung teaches ladder logic in the language and tools you already have: Python, pytest, and VS Code. Start with Know Python? Learn Ladder Logic.
Makers and P1AM-200 users who want a real scan cycle without writing the plumbing. The same program you tested on your laptop generates a CircuitPython scan loop with timers, counters, Modbus TCP, and SD-backed retentive state.
Get started
pip install pyrung, then the Quickstart. Existing CLICK project? ClickNick generates the pyrung source from your .ckp.
Under the hood
laddercodec is the compatibility layer for CLICK ladder data, enabling reliable round-tripping between CLICK and the pyrung/ClickNick toolchain. pyclickplc talks Modbus TCP to a CLICK PLC.
Rather keep drawing ladder in CLICK?
ClickNick adds nickname autocomplete, program checks, offline runs, and your ladder (as Python) after every save. Built on pyrung.