Siemens PLCs
Continuing the series I began last week with the Allen-Bradley PLC platform, this week I am discussing the Siemens family.
My first exposure to Siemens PLCs was in the late 1990s when I customer wanted a quote on upgrading their S5 based system to an S7, which at that time was the new platform. The original S5 platform was developed by Siemens in the late 1970s/early 1980s as the initial offering of the “Simatic” family. As technology improved through the 1980s and early 1990s new processors and components were released. In 1996 Siemens unveiled a new platform they called “Totally Integrated Automation” or TIA. The first S7s went on the market at that time with a different software platform called Step 7, unfortunately this was not compatible with the older S5 series.
The S7 family originally consisted of the S7-200s, a smaller, simpler platform in the Micro PLC (self-contained) category; the S7-300s, a rail-mounted modular PLC in the mid-range of capabilities, and the S7-400s, a rack-mounted platform with a larger frame and much more capability and functionality.
The S7-300 family has CPUs with escalating capabilities and cost. The S7-312 is a slower processor with about 6K of data memory and 20K of program memory. The S7-313 increases the data memory to 12K while the program memory remains the same; however an EPROM can be added increasing the program memory to 4MB. The S7-314 data memory increases to 32KB and the program memory to 48KB. The S7-318-2 has 256K of data/code memory, load memory is 64K while the same EPROM addition is possible with successive processors. The most powerful S7-300 processor is the S7-319. The S7-300 family is modular but doesn’t use a rack; instead C-Connectors are used to connect modules from the back side extending the backplane or bus.
The S7-200 family will soon be discontinued since technology has improved. The newer 1200 and 1500 series have replaced them, but they use a different software platform than Step7 or MicroWin called Step7 TIA Portal.
The S7-400 series is a rack-based system with and active backplane. This means that multiple CPUs can be placed in the same rack. Racks are available with 4, 9 or 18 slots and up to 22 racks can be connected together using interface modules.
Both the S7-300 and S7-400 systems have a wide variety of communication options both in the processor or by using communication modules. Serial communications and programming is done using MPI (Multi-Port Interface), an RS-485 based communications protocol. Many processors also have a built-in DP (Decentralized Peripherals) port used for I/O modules or standard processor communications. This is used for PROFIBUS, a Siemens PRocess FIeld BUS widely supported by third party manufacturers. This allows for a huge variety of modules and devices to be interfaced with the PLC.
Software: As described before, the main programming package used for the S7 family is Step7. Unlike A-B, communications is built into the programming software. A Step7 Lite package can be purchased for use only with the S7-300 family (and the C7, not described in this post). While less expensive, it does not have networking capability or special functions.
The standard S7 programming software supports three programming languages; ladder logic (LAD), statement list (STL), and function block diagram (FBD). The Step7 Professional package also includes a simulation package, PLCSIM, that can be used for debugging programs. Additional modules can also be added to the Step7 Professional package for programming in sequential function chart (SFC). This package is called S7-Graph. Another add-on package is used for programming in Siemens version of structured text, called SCL, or Structured Control Language. This is a high level language similar to procedural languages like PASCAL or C. This package can be especially useful for complex algorithms or math, data and recipe management or iteration using arrays.
Data types in Siemens are like most other platforms, using bits or BOOLS, integers, double integers and floating point or REALs. Byte level usage of data is also common, especially since the Siemens IO structure is Octal. Great care must be taken with data however, since the INT data type and WORD data type are used differently. One can be used for math and the other for logic operations such as AND, OR, XOR, etc. Additionally, addresses can overlap in the marker memory area (MW10, M10.0, MB10 and MD10 all occupy the same space, though MW10 encompasses MB10 and MB11, while MD10 includes MB10,11,12 and 13). This addressing structure allows for access to M data in flexible ways, but requires careful address management. Timer and Counter memory is addressed as T1, T2, T3 or C1, C2, C3 etc. Timers include a variety of types such as On Delay, Off Delay, Pulse, Retentive, etc. while counters are available for both up and down counting. Siemens counter instructions can be considered as nearly useless; 1. The counter is considered “done” when it reaches 0; and 2. The maximum setpoint is only 999. For this reason most programmers simply used data registers and increment a number.
Rather than using pre-assigned marker memory, most data is constructed by the programmer using Data Blocks, or DBs. These blocks can be composed of all of the elementary datatypes (BOOLS, INTS, Timers, etc.) as well as using UDTs. Data blocks usually compose most of the program memory usage in a program rather than using the M registers.
Routines in Siemens programming use a variety of different structures. Organizational Blocks or OBs are used for predefined purposes; for example OB1 is the routine that will run first in a typical continuous scan program. OB30-39 can be assigned to periodic tasks, while other OBs are called for programming, I/O or other faults. These OBs allow a fault to be trapped without stopping the processor.
Functions (FCs) are used in a similar way to subroutines. They can be passed variables but have no memory assigned to them as such. Function Blocks on the other hand have a data block or DB assigned to them and can serve as reusable code. For instance, a function block can be called multiple times using different data blocks for different processes.
Inputs and outputs use the symbols I and Q for their respective symbols. Analog addresses use process words (PIWs) for their data tables. Unlike some other PLC platforms, Siemens addressing can be assigned within the individual cards and do not need to be addressed by slot number; instead, a slot will be mapped to whichever area of an input or output table the programmer desires.
Siemens software can be quite expensive like Allen-Bradley’s, although the networking software is built into the package. HMI software can also be directly integrated into the programming package. The Simatic Manager is used to access all of the different aspects of the Step7 integrated packages. The newest software, TIA Portal is said to be even more flexible, though I have no first hand experience with it.
The Siemens platform is very powerful and geared toward using reusable code. There is no direct online editing, however individual OBs, FCs, FBs and DBs can be edited and downloaded without stopping the processor. This is the next best thing to actual online editing but can be confusing if you don’t keep track of what is being edited. It is also very easy to break the program if you don’t do things in the right order. For instance, if you use a UDT to in a DB, then modify the UDT, the DB has to be reconciled and reference data regenerated. If you forget to download something that is called or used by another routine it can take a while to figure out where you went wrong. It is not uncommon to have 10 or more windows open during development including Simatic Manager, Hardware Configuration, the Symbol Table and 4 or 5 routines. Uploading a program is also not advised as it will destroy whatever comments and symbols you have assigned in the existing blocks. Altogether more difficult to use than the Allen-Bradley software, but possibly a bit more flexible.
As I mentioned last week, Siemens and Allen-Bradley own a significant portion of the PLC market both worldwide and in the US. Because of this both hardware and software are some of the most expensive on the market. Siemens doesn’t seem quite as bad as A-B on incrementally changing software and having to upgrade licenses, part of this is because they don’t revise their software as often. Siemens Step7 software is currently on revision 5.5, while A-B’s ControlLogix is on about version 21 or 22.
Many European programmers prefer STL programming to Ladder. Because of this it is important to be able to program in both. While Ladder can always be converted to STL, the reverse is not true, necessitating the fluency in both languages.
Overall I prefer the A-B software to Siemens, but I also have quite a bit more experience with it. The RSLogix software is more intuitive and user friendly, but the Siemens platform probably allows for more flexibility. I will also always be a fan of tag-based programming rather than use of register-based addressing. I teach classes in both Allen-Bradley and Siemens and most of my students who use both would concur. Of course I live in the US, so they may be a bit biased.
The new platform Tia Portal, with which you can program S7-300/400 PLC, S7-1200, S7-1500, has been a real revolution for Siemens. Step7 Professional was very basic as a programming environment, with Tia Portal instead, the gap with RSLogix 5000, according to me it is filled. Maybe it’s heavier as a platform, but the integration with HMI represents a crucial turning point for the productivity of the software.
Everything is very open with a very clear clarification of the issues. It was definitely informative. Your site is extremely helpful. Thanks for sharing!