Hardware
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-300 Micro Memory Card (MMC) recovery
- If you need to save or replicate MMC cards, go to http://personal.telefonica.terra.es/web/suwe/ and download free MMC read/write tools. Courtesy of Rene'.
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: http://www.cs.umass.edu/~verts/cs32/endian.html
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 http://sourceforge.net/projects/libnodave
S7-200 PPI protocol
- Delphi unit for Siemens PPI link, freeware with full source code included. Courtesy of Lazarus (lazarus (at) delphi-coderz.de)
- You may also contact Vladimir Shishkov at http://www.bitman.ca
AS511 protocol (S5 programming port protocol)
- To create your own communication driver via programming port of SIMATIC S5 PLC's, download my Siemens Step5 AS511 protocol description
- Delphi VCL component for Siemens S5 AS511 protocol, freeware with full source code included.
Courtesy of Lazarus (lazarus (at) delphi-coderz.de)
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
- 3964R protocol description is available in CP340/341/440/441 manuals for S7 systems, download the free manuals from Siemens website
- Delphi unit for threaded Siemens Step5 3964R protocol, freeware with full source code included. Courtesy of AIT. http://www.ait-augsburg.de/downloads.htm
MODBUS protocol
- DELPHI threaded driver for Modicon MODBUS. This components are free and without any limitations but not source code included. Courtesy of Slavomir Skopalik http://www.elektlabs.cz/downloads/freemodbus.zip
- C# 2.0 MODBUS implementation at http://www.nmodbus.com/Samples.aspx
Siemens PRODAVE library
- Delphi unit for Siemens Prodave, courtesy of Lazarus.
OPC Programming with Borland Delphi
- Develop OPC client and server http://www.opcconnect.com
Siemens WinCC
- Read WinCC tags with a Delphi component! Courtesy of Jorge David Velez Mendez, visit his web site at http://www.gratisweb.com/picol/wintag.htm
Serial monitors, analyzers and sniffers
- Take a look at HHD's Serial Monitor: http://www.hhdsoftware.com
- Download here the Testcome free RS232 analyzer.
- Do you need an RS232 analyzer but your notebook has only one serial port? Download Sysinternals' Promonitor , it records ports data and all related Windows messages (OpenComm, Flush, etc.). Works also via TCP/IP, you can monitor the ports of a remote PC ! Several other nice PC monitoring utilities available for free download at http://www.sysinternals.com.
Ethernet monitors, analyzers and sniffers
- Download an Ethernet network protocol analyzer from http://www.ethereal.com
STEP-7 issues
Import Step7 datablocks into Excel
Ever worked with those nice guys belonging to "SCADA developing people" ? They need to "tag" each PLC value before using it within their SCADA and therefore they need a complete table of all SCADA-related PLC values along with their type declaration and address in PLC memory. Those people know a lot about SCADA but many of them do not know how to move within the Siemens S7 developing environment. In most cases, even if you can obtain a printout of the datablock along with the addresses, you can not use it for automated tags creation and you need to manually type every variable. You may be tempted to copy the contents of a Datablock and paste it into an Excel spreadsheet, but unfortunately this operation does not paste the variable addresses within the datablock. It is a minor problem if all the data belongs to the same datatype (eg. all Integers or all Reals), but it is a real problem if you have a Datablock created using structures with mixed data types. You could install a fake "Generic/text only" printer in Windows and redirect the output to a text file but I experienced problems: at every page break a whole datablock line is lost. So here is my solution:
- Use Adobe Acrobat PDF Writer (or other PDF creator programs) and print your datablock to a PDF file.
- Run Acrobat Reader and open the generated PDF file. Use "copy text" functions to copy the datablock table data onto clipboard (include the table headers too).
- Paste onto Excel as a single column.
- Select the column (click on column's header) and assign the data separators (select "char separated fields" and "space" as separator character).
- All done... Now you've an Excel table with all the data you need to save you a lot of boring (and error-prone) work. Enjoy
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 http://www.sea.siemens.com/automat/cad/index.html
Suggested PC desktop tools
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: http://www.softexe.com
I've been using this utillity 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: www.realtimesoft.com/ultramon
Suggested PC remote control and web conferencing tools
VNC
VNC is a freeware PC remote control software (Windows and Linux!), it comes in different flavours:
Unyte
- Unyte integrates with Skype and offers a web interface to a remote PC. Payware. www.unyte.net
Teamviewer
- Teamviewer is fast and does not need installation. Payware but with some free time amount per month. www.teamviewer.com
Linux related
Free Linux realtime environment
- a software integrated environment used for the development of industrial process control softlogic applications. Courtesy of Roberto Finazzi http://www.rtautomation.it/
Linux PLC & Realtime links
Miscellaneous
Speed problem with old DOS programs
- Your old 286 or 386 PC has gone.. you tried to run some old 286 programs on a new PC but they do not run just because current PCs are too fast. What to do? Download here a free PC slowdown utility, your program will run as if it were swimming in the honey. Turbo Pascal source code is included.