How it works
Python at edit time.
Native vendor file on the PLC.
Koyl is a compiler. The source is Python; the output is a vendor's native project format. The PLC runs exactly what it always ran.
Below: the three-step flow, what your code actually looks like, and why Python is the right source language for industrial work.
The flow
Three steps. Source to controller.
01
Python source
What you write in the Koyl editor. Function blocks, routines, and global variables, declared as standard Python with type annotations. Every Python tool a software engineer already uses applies here.
02
Koyl compiler
Translates your Python into the target vendor's native project format. One source. Three possible outputs: Allen Bradley L5X, Siemens SimaticML, or Beckhoff TcPOU.
03
Vendor file
Opens in Studio 5000, TIA Portal, or TwinCAT 3 like any other project. Downloads to the controller exactly as before. The PLC runs what it has always run.
What you write
Standard Python. Function blocks, inputs, outputs, timers.
from datetime import timedelta
from plx.framework import TON, Input, Output, fb
@fb
class ValveCtrl:
cmd_open: Input[bool]
feedback: Input[bool]
valve_out: Output[bool]
is_open: Output[bool]
fault: Output[bool]
fault_timer: TON
def logic(self):
self.valve_out = self.cmd_open
if self.cmd_open:
self.is_open = self.feedback
self.fault_timer(IN=not self.feedback, PT=timedelta(seconds=3))
self.fault = self.fault_timer.Q
else:
self.is_open = False
self.fault = False
The class is a function block. Inputs and outputs are typed. The
logic()
method runs once per scan cycle on the controller.
The compiler
We parse Python. We don't execute it.
Koyl's compiler accepts the subset of Python that maps to IEC 61131-3, the language your controller actually runs. The result scans deterministically, the same way ladder logic does. No Python on the controller; the vendor file is what executes.
Why Python
The right source language for industrial code.
Industrial software was forked from mainstream software twenty years ago
Version control, code review, type systems, automated tests, packaging, formatters, language servers. None of that is standard in the PLC world today. Building a new domain-specific language recreates the gap. Choosing Python erases it.
Python is what AI is fluent in
Frontier models have seen more Python than any other source code. Industrial logic expressed in Python lands in the densest part of the model's training distribution. Generic models on Structured Text or ladder logic perform worse, and always will, because the distribution is what it is.
Industry already uses Python at the SCADA and HMI layers
Above the controller, Python is already the default for scripting SCADA dashboards, HMI logic, and integration glue. Koyl brings the same language down to the controls layer, so the whole stack speaks one language end to end.
Python at edit time. Native vendor file at runtime
The PLC runs the vendor file at scan-cycle deadlines, exactly as it does today. Python is the source of truth, not what executes on the controller. The compiler bridges the two.
See the rest
The full toolchain ships to design partners.
Hands-on access to the Koyl IDE, chat agent, simulator, and full vendor support. Direct line to the team building it.
Apply for design partner program →