Remix.run Logo
amelius 3 hours ago

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?

procarch2019 an hour ago | parent | next [-]

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.

stackghost 3 hours ago | parent | prev | next [-]

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

Kim_Bruning 2 hours ago | parent [-]

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

Ostensibly yes, but so far I haven't seen anyone really use a PLC in a way that requires hard real time (so far). The cycle on eg a siemens S7-1200 is anyway much too slow for anything really exciting, and a Pi might very well be more reliable in actual practice, were it not for the very unfortunate tendency to eat SD cards. :-P

(And revolution pi actually ships a hardened Pi for industrial use. So that's one way to go about it. I'm not a big fan of that brand, but it's a data-point. Meanwhile in personal experience some regular pi's left in industrial cabinets for one-off emergency monitoring purposes have managed to stay annoyingly alive over time.)

tamimio 2 hours ago | parent | prev [-]

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.

Kim_Bruning an hour ago | parent [-]

I used to think codesys on raspberry pi was pretty much the pessimal application of an ARM processor (and nothing has changed my mind so far). Here you have a chip that is famous for staying stone-cold and doing interrupts in microseconds , and instead you run it hot on a 50Hz (default) PLC loop instead.