Pong On Industrial Controllers

Programmable Logic Controllers (PLCs) are a staple of control automation. Sometime in the 60s or 70s, they replaced a box full of relays to implement the kind of “if-this-then-that” logic that turns thermostats on or directs machinery. Sometime in the 90s or 2000s, some more computing power was added, giving us the Programmable Automation Controller (PAC). And if reading Hackaday has taught us anything, it’s that if you give people a little bit of computing power, they’ll implement Pong (or Snake or Doom!).

We were sent a link where [AbsolutelyAutomation] does just that: implements a remotely-playable Pong on a bit of industrial control. Even if you don’t have a PAC sitting around, the details are interesting.

The first step is to get graphics out of the thing. The PAC in question is already able to speak Ethernet, so it’s “just” a matter of sending the right packets. Perhaps the simplest way to go is to implement the remote framebuffer (RFB) protocol from VNC, and then use a VNC client on the PC to send the graphics. (As they point out [CNLohr] has done this quite nicely on the ESP8266 (YouTube) as well.) So an RFB library was written. [AbsolutelyAutomation] points out that this could be used to make boring things like user-friendly configuration and monitoring screens. (Yawn!)

Graphics done, it’s easy to add a Pong layer over the top, using the flowchart-based programming interface that makes homage to the PLC/PAC’s usual function as an industrial controller. (Oddly enough, it seems to compile to a Forth dialect to run on the PAC.) And then you’re playing. There’s code and a (PDF) writeup available if you want more info. If you don’t have a PAC to run it on, the manufacturers have a simulator for you.

We’ve never worked with a PLC/PAC, but we know the hacker spirit when we see it. And making something that’s usually located in the boiler room play video games is aces in our book. This sparks a memory of an industrial control hacking room at DEF CON a few years back. Maybe this is the inspiration needed to spend some time in that venue this year.

We know we’ve got controls engineers out there. What’s the strangest thing you’ve programmed into a PLC?