Friday, June 1, 2012

Getting a Simatic S5 up and running

While cleaning up my storage room, I came across some interesting pieces of hardware.
As I tend to keep almost everything, vastly recognizable as something potentially usable I gathered quit a collection.
So one of the pieces I rediscovered is a gray box with some screws to tap wires in to...
Thoughtfully I kept it in its original cardboard-box and I discovered the instruction-manual along with it.
The piece of plastic turned out to be a Simatic S5 central unit.
As I am not familiar with PLC-systems I spend roughly an hour reading the manual to discover some of the basic functions.
But reading manuals is not quite as fun, as hacking the equipment.

1. Step: Supplying power...

As with most hardware, this system needed a power supply. Unfortunately 24V DC. And 1A under normal load-circumstances.
Neither did I happen to have a 24VDC power-supply,  nor did I have to car-batterys to power the thing up.
So I whipped something up using an old AC-converter found in a box of old discarded Christmas-lights...
The PSU supplied 24V AC. Fortunately I have a box with scrap-parts and some rectifiers. Converting 24V AC to DC was easily done and I spiced the PSU with a capacitor to straighten out the voltage a little.

2. Step: Dry run...

After figuring out the power-supply the system was hooked up.
With the switch of the power-switch the system sprang to life.
But as I am missing a program to run on the hardware, only the self-test was done. It passed and parked the system in idle-mode.

3. Step: Where to go from here...

As everything on the system is proprietary by Simens, I had to stick to the documents available.
Fortunately I found a schematic of the PG-interface (PG standing for the German word "Programmier Gerat", meaning programming-machine or something similar).
I had to discover, that the PG-interface used TTL 15V to 24V signals-levels. Much to much for RS232 found in the serial-connection of a PC. Also the information on the TTL-line are encoded differently. So I had to find a converter.

Fortunately the MAX232 does exactly this, but it only supplies TTL 5V signals.
Since I had already developed something very similar (a AVR-USB-ISP) I considered using this device as a basis for creating a USB-interface for the Simatic.

4. Step: Wait for the hardware-delivery...

After designing the converter, I only need to wait for my hardware-delivery and I will try to code something for this old piece of hardware.