Go Down

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

jacques_de_hooge

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

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:

https://pypi.python.org/pypi/SimPyLC

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



Kind regards
Jacques de Hooge

robtillaart

Rob Tillaart

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

jacques_de_hooge

#2
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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy