logoalt Hacker News

ameliusyesterday at 11:04 PM5 repliesview on HN

Forgive my ignorance but isn't a PLC simply a computer with some GPIO ports? I.e., a Raspberry Pi could be called a PLC? Why are we talking about them as if they are something else? Is it an exotic OS that makes them different?


Replies

spauldotoday at 5:36 AM

The term "PLC" is a lot more specific than "computer with some GPIO ports." No one that works with PLCs would consider a Raspberry Pi to be one.

These things are walled gardens. You never see the operating system. You can only change their behavior using the vendor's software. They generally run a single program (that you write using the vendor's software) on a fixed scan cycle. They read the inputs, run your program, write the outputs, then repeat.

While you're giving up the nearly infinite possibilities that an SBC gives you, the benefits more than make up for the lack of flexibility. They run (and have parts and support available) for decades. Modules are easy to diagnose and replace. An electrician who isn't a programmer can follow ladder logic and troubleshoot problems. Integrators can quickly come up to speed and understand your code.

There's a reason companies will pay tens or even hundreds of thousands of dollars for these things.

procarch2019today at 1:33 AM

The point I was making is that PLCs have a software stack. You have to know the software and programming languages defined in IEC 61131-3. For all intents and purposes they are just very repeatable compute in an industrial setting, but if you don’t know ladder logic or how to interface with them you might be SoL. Most don’t have any sort of web interface and if they do it operates outside the controllable logic. Same goes for shells. If you want to program it you typically have to use the vendor software.

cyberaxtoday at 3:42 AM

Technically it is, but in practice they often speak very obscure protocols over non-Ethernet links.

Honestly, I think it's an advantage at this point. Way too much diversity to easily attack remotely.

stackghostyesterday at 11:54 PM

If a Raspberry Pi had industrial environment ratings and was certified hard real time, then yes it could be considered a PLC.

All the ones I've encountered in the wild ran VxWorks

show 1 reply
tamimiotoday at 12:11 AM

Not really, sure you can use a rpi to control some hw but they are not the same, a PLC usually run rtos, is deterministic (you can predict timing) while rpi relies on linux OS and its scheduler, the PLC also uses ladder language or function block compared to rpi high level language, and obviously PLC industrial grade I/O both analog and digital that also deal with voltage noise that usually happens by field sensors, and environmentally rugged and rated to run non stop compared to rpi.

Now, if you really want to use rpi as a plc, you need something like openplc or codesys as a runtime, add some HATs for I/O, and use protocols like modbus. It will be a software plc but you are missing the hardware certification and other features. Rpi is good as edge computing rather than plc, like processing vision or data logging, it’s why in drones you need the autopilot AND rpi or companion computer, each does certain functions.

show 1 reply