mprymek
Hello,

if it's of any interest to you, I have made a PoC port of OpenPLC core to PlatformIO/Arduino. It's tested on ESP32 but it's easily portable to any other MCU.
  • you can run Structured Text code right on the MCU (MCU is not a slave, it acts really as a PLC itself)
  • no communication protocols support for now, just GPIO & ADC
  • no web, program upload etc., you just compile your ST program and run it on the MCU
  • it runs on Linux x86_64 also (for debugging mostly)
You can download it from here:  https://github.com/mprymek/mcu-plc

It's really just a PoC but I thing it could be interesting for students, researchers, makers etc. at least as a starting point.

Any comments, suggestions and pull requests are warmly welcome.

Thanks for your excellent work on OpenPLC!
Quote 2 0
thiagoralves
Great work mprymek! I’ll take a better look at this and, perhaps, include it on the main OpenPLC runtime. My idea is to use this to allow hosts running the full runtime to program slave devices with small ladder logic files. Then slave devices will be able to run some computation independently of the hosts.
Quote 2 0
mprymek
Update:
- experimental communication implementation using CAN bus and UAVCAN protocol (https://uavcan.org/)
- ESP32 or STM32 slaves

Demo: 


Code needs some cleaning and commenting, hopefully will be published soon.
Quote 1 0