I built a numpad-only language for PLC programming
The Problem PLC programming in 2025 still looks like this: Open a 2GB proprietary IDE Click "New Rung" Drag a NO contact from a palette Click to place it Type the address in a popup Repeat 500 times For X1 AND X2 → Y50 , that's 12 mouse clicks . The Solution 1 2 = 50 One line. 8 characters. Zero clicks. I built BNS Lang — a minimal DSL where numbers are I/O addresses and symbols are logic operators. The entire grammar is 15 lines of BNF. How it works Numbers = I/O addresses Space = AND (series) | = OR (parallel) - = NOT (normally closed) = = output coil Self-holding motor circuit Every PLC engineer writes this 100 times a year: 1 -2 | 100 = 100 This compiles to: ──┤ X1 ├──┤/X2 ├──┬──( Y100 ) │ ──┤Y100 ├──────────┘ And outputs IEC 61131-3 Structured Text: Y100 := ( X1 AND NOT X2 ) OR Y100 ; Traffic light controller T302 -T300 = 100 # Green phase T300 -T301 = 101 # Yellow phase T301 -T302 = 102 # Red phase 100 = T300 5000 # Green timer 5s 101 = T301 2000 # Yellow timer 2s 102 = T302 5000
Continue reading on Dev.to JavaScript
Opens in a new tab



