Go Down

Topic: Generating Arduino code from Python PLC simulator. (Read 667 times) previous topic - next topic


Oct 08, 2015, 01:51 pm Last Edit: Oct 09, 2015, 10:28 pm by jacques_de_hooge

I am a teacher at the Hogeschool Rotterdam, department Technical Computer Science.
In order to make the power of simulation available to our students, I've written an freeware PLC simulator that allows real time inspection, modification, plotting and visualisation of all variables. The simulator itself is written in Python, but with the latest addition it can generate C code for the Arduino.

The workflow would be as follows:
- First simulate the complete application using PLC elements like timers, oneshots and registers.
- Hardware interaction and physics can be simulated in separate PLC modules.
- Debug the control using timing charts and real time inspection and modification of variables.
- As a last step, if everything is functioning well, generate C code, upload it to the Arduino and add reading from Arduino inputs and writing to Arduino outputs.

I've found that this type of simulation makes development MUCH easier.
A beta version can be downloaded from:


This is a preliminary version. It will no doubt contain bugs. Feedback is welcome.

Kind regards
Jacques de Hooge


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Oct 17, 2015, 11:20 am Last Edit: Oct 17, 2015, 12:54 pm by jacques_de_hooge
There are now several example applications for Arduino code generation.
The most extensive (yet simple) one is a traffic light installation.
Its I/O assignment is for the Arduino Due, but can easily be changed to fit the One.

Go Up