Go Down

Topic: Siemens Simatic S5 - Arduino control panel (Read 291 times) previous topic - next topic

Lynx_N

Hello World :)

Here's a useful thing for Siemens Simatic S5 PLC's, it's an, however simple, Arduino/Adafruit LCD display- based operator panel designed to change the value of a dataword in a datablock in the PLC, will come in handy where there's a need for frequent changes of such a value.
It's based on using the navigation keys (Adafruit 2x16 LCD display with integrated buttons) for changing the value itself and then pressing the Select button in order to send the new value to the PLC.
I used such an Adafruit display including buttons which was originally designed for a Raspberry Pi, but I adapted it to a Arduino Mega instead, which wasn't too hard given that there's only 4 wires in all (+5V, GND, SDA and SCL) and those pins are already available on the Mega as is.
Hopefully I've explained the whole shebang in the sketch, shouldn't be all that hard for whoever to adapt the code to suit your own needs.

Sources and inspiration:
AS511 protocol description : http://www.runmode.com/as511protocol_description.pdf
Converter TTY/RS232 : http://www.plcman.co.uk/232_20ma.zip (the "original" converter, the first one I replicated in order to be able to connect to a S5 PLC, works just fine!)
Schematics (of the above) TTY/RS232 converter : http://siodemka.p.lodz.pl/~kazz/rs2tty_838.gif
Serial sniffer mod (for Realterm) : https://embeddedfreak.wordpress.com/2008/08/17/rs232-serial-sniffermonitoring-circuit/
Realterm : http://realterm.sourceforge.net/ . Display data in HEX (with space), also make sure to set the correct serial protocol. I run this program on an old laptop running XP and it actually takes a little bit of fiddling back and forth with the controls/menues to make it display the data the way I want it to.
Arduino Mega / Adafruit wiring : https://learn.adafruit.com/system/assets/assets/000/001/439/medium800/lcds___displays_RGB_LCD_WIRING_rev1.png?1396772126
Adafruit Pi GPIO : http://elinux.org/images/2/2a/GPIOs.png

Note: Keep TTL (which includes both the Arduino serial ports and the AS511 PLC TTY interface) comletely separated from RS232 voltage levels at all times.
Mixing the two (TTL and RS232 voltages) can/will lead to destroying the Arduino's and/or the PLC's serial interfaces.
Use the schematics provided, which is based on the TTY/RS232 converter, as it works just fine both as an interface between the Arduino and the PLC and also as an interface to the serial sniffing computer running Realterm.

Good luck :)

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