I work for a company that uses PLCs in their products, but lately, we have thought about doing away with our PLCs for application-specific circuits, FPGAs, or some other type of system on a chip that can implement all the features on the PLC.

Does anyone know which route would be best to go for modern control systems? It will require PID controllers, closed feedback loops, and ladder realtime logic - or at least very close to real-time logic. We would need to write the software in C/C++.

Also, are there any C++ frameworks or libraries that could support these control systems in a modular way. We have multiple different products with different control requirements - it would be nice to use the same hardware with all the devices and then load the software per specific product. Having a framework would avoid redoing a lot of work.

  • \$\begingroup\$ Use a processor or microcontroller. FPGAs are a different beast and don't run "software" or use C/C++, but it may be useful to include one along with a microcontroller for future proofing the hardware. People do not use FPGAs unless they have to. Your typical PLC doesn't use an FPGA. A PLC is just a processor with ruggedized hardware around it. \$\endgroup\$ – DKNguyen Oct 25 '19 at 15:07
  • \$\begingroup\$ You can buy dev kits for certain microcontrollers that allow you to run ladder logic, however there aren't a lot of "ladder logic compilers" for microcontrollers. Usually those that buy these kits are making PLC's. For end-use you would write your code directly in C. The most famous of these is probably the CodeSys runtime but you really are looking at many 10's of thousands of dollars for the kit, and much more for integration. This only makes sense if you are mass-producing something that needs end-user programmability. \$\endgroup\$ – Ron Beyer Oct 25 '19 at 15:13
  • 1
    \$\begingroup\$ I'm an industrial automation engineer and your finished product would lose many marks on a supplier comparison matrix for having a closed source piece of hardware and custom code. I'm using and supporting PLCs that were installed in the 1980s and spares continue to be available on eBay, etc. If your company closes the customers are helpless. \$\endgroup\$ – Transistor Oct 25 '19 at 16:10
  • 1
    \$\begingroup\$ It’s a pretty big leap from PLCs to (customized) microcontrollers. PLCs have everything out of the box ready to go, need an input card part #ABC124, need an analog card part number ABC123. You would need to design all of your own ‘cards’ (if that’s how you would choose to do). \$\endgroup\$ – Tyler Oct 25 '19 at 16:39

From a speed and complexity perspective, this is almost certainly best dealt with using microcontrollers or microprocessors. FPGAs are nice when you need screaming-fast processing, but they cost lots more to buy and to design for.

You may want to take some PLCs apart and see what's inside -- I suspect you'll find microprocessors in there.

I'm not sure you'll find library support beyond the manufacturer's normal help with getting peripherals to work -- I would suggest, though, that you take it upon yourself to write a hardware abstraction layer that acts as drivers for the hardware on your board, and that your application code can work with.

On a less immediately technical note, if you don't have people on staff that have done this sort of embedded work, you may want to hire someone who's been down that road and has been successful; then put them in charge of the architecture (or listen to everything they say). There are lots of little pitfalls, and it's not like this hasn't been done before.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.