Copyright © 1998-2017 Luca Gallina

Runmode, programming Siemens PLCs

Free tools, hints, tips and tricks. Interesting and specialized applications are also on sale, all developed by programmers for programmers.


Useful stuff

How to protect your valuable CPs and COM ports

...or "how to connect your pc to any device without destroying your communication ports"

Well, in industry you never know. When commissioning at customer's facility you are never sure whether the machine you're operating on is properly grounded, whether the negative DC voltage is grounded, whether the machine and your PC supply socket share the same ground circuit. And when you connect your PC to the PLC port with a communication cable...SPARK! The communication port is gone!  So, before connecting any communication cable between PLC and PC, first connect a common ground line between the devices. Use a normal ground wire and be sure to tighteen it at both sides.

In the old STEP-5 days, damages to the serial port were not an infrequent event. With STEP-7, unfortunately, it seems that things haven't changed much. Perhaps it was just good old Murphy having some fun, but after having worked for 6 years with my Profibus cards without any problems, I suddenly damaged two different CP5611s in a matter of a month! I presumed CPs were protected by optocouplers, but I'm not so sure now... If your CP is still under guarantee, send it to Siemens and you'll get a repaired one in a very short time. On the other hand, if you have damaged an old CP you may attempt to repair the card by yourself. It's very likely the damage can be narrowed down to an RS485 chip especially designed for Profibus: the Texas Instruments SN65ALS1176 or the equivalent Analog Devices ADM1486. Locating the chip on CP5611 is very easy, just follow pins 3 and 8 of the 9-pin sub-D connector, the very first chip you encounter is the RS485 driver. On my CP5611 it is a small 8 pin SMD marked 6A1176.

S7-1200 (and S7-200, -300, -400 as well) Data Blocks backup

Tired of loosing DB data every time you download an updated program to an S7-1200 CPU (or S7-200, S7-300 and S7-400 as well)?

If you can connect to the PLC by an Ethernet link, here comes an handy utlity. Courtesy of Slavomir Skopalik.

 S7-300 Micro Memory Card (MMC) recovery

If you need to save or replicate MMC cards, go to and download free MMC read/write tools. Courtesy of Rene'

STEP-5 issues

Going online with an USB/RS232 adapter

Todays laptops come with no onboard serial ports so you have two solutions: rather costly PCMCIA serial cards (watch for base address and IRQ settable ones only) or cheap USB/RS232 adapters.

Emulating a serial port with a USB/RS232 converter is not always successful and might depend on the specific type of USB converter you are using and related Windows drivers. Just to mess up things, the emulated serial port may be listed as COM1 in the Windows' control panel but accessible only as COM3 by the Step-5 programming software. Once you succeed in having the S5 software communicating with the PLC, for the most of joy you may then experience sudden system crashes (blue screens) with no apparent reason.

On my Win XP Pro laptop I solved all my problems running Step5 v7.23 on a virtual machine (VMWARE v6.0 running a WinXP installation) and using a cheap USB/RS232 converter (mine is listed as a "Prolific USB to Serial Port"). From that moment, not a flaw!

Online problems with STEP5 and Windows98

Running Step5 under Win98 and cannot go online? Downloaded S5ENCOMM.EXE patch from Siemens and still cannot go online?

Run REGEDIT, search for "Hkey_Local_Machine -> System -> CurrentControlSet -> Services -> VxD ->VCOMM"

Modify the "EnablePowerManagement" value from "01 00 00 00" to "00 00 00 00". This will disable the RS232 port low power mode.

Close REGEDIT and reboot

Drawings and schematics

Siemens S7 symbols

Automation devices CAD drawings and symbols CAD drawings of S7 products at

Suggested PC tools and add-on

File navigator

I would never go anywhere without it. Ghisler’s Total Commander! A must! Go

Cursor hider

How many times are you moving the mouse away because its cursor overlaps the text you are typing? Try the Cursor Hider by SoftExe: .   I've been using this utility for years and I'm very pleased of it.

Ultra monitor

Do you make use of more than one monitor? No?? Then you must!

After setting up your additional monitor, install Ultra Monitor utility:

DOS PC slowdown utility, have it run like ants in the honey

In case you still have to replace DOS machines with newer hardware, you may encounter issues related to the higher CPU speed.

Applies both to real machines or virtual machine.

Download here the “honey” slowdown utility, source code included.

Suggested PC remote control and web conferencing tools


VNC is a freeware PC remote control software (Windows and Linux!), it comes in different flavors:


Teamviewer is fast and does not need installation. Now free for single users


Mikogo is yet another free PC remote control and screen sharing application, allowing multi-participants online meetings and group collaboration


Unyte integrates with Skype and offers a web interface to a remote PC. Payware.

Communication: protocols, interfaces, analyzers

Notes on Simatic data storage

Whenever you need to read or store values on Siemens PLCs, you must be aware that SIMATIC systems adopted the Big Endian byte order, see a brief description here:

Snap7, a free multi-platform Ethernet communication suite

Snap7 is an open source, 32/64 bit, multi-platform Ethernet communication suite for interfacing natively with Siemens S7 PLCs. The new CPUs 1200/1500 and SINAMICS Drives are also partially supported.

Although it has been designed to overcome the limitations of OPC servers when transferring large amounts of high speed data in industrial facilities, it scales well down to small Linux based arm boards such as Raspberry PI, BeagleBone Black, pcDuino and CubieBoard.  Three specialized components, Client, Server and Partner, allow you to definitively integrate your PC based systems into a PLC automation chain.
Courtesy of Davide Nardella

NetToPLCSIM, S7-300/-400 PLCSIM connectivity on the net

This freeware application connects any S7protocol capable application to Siemens S7 PLCSIM via Ethernet connection.

You can now connect to PLCSIM a WinCC application running on virtual machines (VirtualBox, Vmware, etc) or separate PCs.

Courtesy of Thomas Wiens

My patched version for use with Win7 x64

The original version of NetToPLCSIM v 0.7.2 does not run on Win7 64 bit and also the command to stop the Simatic IEPG Help Service differs a bit. You then need either to recompile the sources or patch the original EXE with the Microsoft “corflags” utility to force 32bit execution in 64bit environments. Download here the patched version of NetToPLCSIM for Win7 x64, zipfile include batch files to stop Simatic IEPG service in both 32 and 64 bit environments.

S7-300/-400 MPI protocol

My old documentation on MPI protocol was outdated so I removed it.

If you need to communicate with MPI protocol either via MPI/DP port or Ethernet connection, take a look at Libnodave, freeware version of Siemens Prodave. Courtesy of Thomas Hergenhahn

 S7-200 PPI protocol

Delphi unit for Siemens PPI link, freeware with full source code included. Courtesy of Lazarus (lazarus (at)

You may also contact Vladimir Shishkov at

AS511 protocol (S5 programming port protocol)

If you want to create your own communication driver via programming port of SIMATIC S5 PLC's, download my Siemens Step5 AS511 protocol description.

Youy may otherwise be interested in the Delphi VCL component for Siemens S5 AS511 protocol, freeware with full source code included. Courtesy of Lazarus (lazarus (at)


S5 PLCs (AS511) RS232-20ma TTY converter

Make your homemade RS232-20mA TTY converter to connect to a SIMATIC S5 PLC ! Try this active converter (courtesy of Mike Virgiliev)

3964R protocol

MODBUS protocol

Siemens PRODAVE library

Delphi unit for Siemens Prodave, courtesy of Lazarus.

OPC Programming with Borland Delphi

Develop OPC client and server

Serial monitors, analyzers and sniffers


Ethernet monitors, analyzers and sniffers

STEP-7 issues

Pocket apps


Want to connect and read PLC variables directly from your iPod? iPLC supports wireless Ethernet connections to Siemens S7 and Modbus protocols. Courtesy of OZLB.