Practical Series Automation Library

A library of software modules for the Siemens
Simatic S7-1500/1200 range of controllers

Cover Image

Author: Michael Gledhill

Full site contents

The Practical Series Automation Library — The PAL.

THIS IS THE Practical Series Automation Library of software modules website.

The Practical Series Automation Library (PAL) is a library of software modules and templates that have been developed for the Siemens Simatic S7-1500 range of controllers (and to a lesser extent the S7-1200 range).

The full library and all necessary documentation are available from within this, the Practical Series Automation Library (PAL) website and is freely available to anyone who wants it to use it.

The PAL software structure is such that it is applicable to virtually all industrial applications that can be controlled by a programmable logic controller (PLC).

The PAL contains fully deployable software that has been developed by the author in his professional capacity as a chartered electrical engineer. It is currently in use on various live plants throughout the UK and in some other parts of the world.

The Siemens Simatic S7-1500 and S7-1200 range of Controllers are, what would be generally referred to as, program logic controllers (PLCs). Controller is simply the common term used within Siemens literature for this type of device. For clarity, where a Siemens Controller is being referred to, the word Controller is capitalised (to indicate it is a Siemens Controller, rather than some non-specific controlling device).

In general terms, the PAL software is considered to be suitable for use in the following types of industries (this is not an exhaustive list):

  • Water and waste water treatment

  • Pharmaceutical and batch production

  • Brewing and fermentation

  • Chemical manufacturing

  • Oil and gas systems

  • Food and beverage production

  • Material handling

The software is written to very high standards; these are the standards needed to deploy the software in pharmaceutical environments. It is, in the engineering terminology, a validated system (meeting the requirement of “good manufacturing practice”). I explain all about validation in further sections (see here Section secNo).

For those of you familiar with validated systems, the software within the PAL was developed under a fully validated project with all the necessary documentation that goes with such a process (validation plans, test plans, user requirement specification, functional specifications &c.) and I’ve made all this documentation available too. You can see a full list here: Project Documents

If you don’t understand the software, don’t use it.
If you do use it, you do so at your own risk.

The software (including this website, which is also software, albeit in a different form) is all stored in version control repositories and are available from the GitHub website here: (PAL Software) and here: (PAL Website)

  • These repositories can be quite complicated — particularly if you are not familiar with (the very badly named) Git, its terminology and its old-fashioned command line interface (I refer you to my own site that discusses Git and its various peccadillos here).

The repositories are all public and you can access and copy them (fork in the terminology of Git) to your hearts content.

To summarise, there are basically three components to the website:

  1. The PAL software itself (the library) PAL Software

  2. The associated PAL documentation

  3. The Git repositories (Software) and (Website)

There is unfortunately a fifth component — my sense of humour. I can only apologise in advance. Engineers (particularly English ones) tend to have a dark sense of humour; we deploy it as a robust and vigorous defence mechanism (what others might call cruel and unusual punishment). I’ve noticed similar traits in the police, armed forces and doctors.

Placeholder

I am by profession, a chartered electrical engineer, a bored one, and I programme PLCs for a living. I’ve been doing it for years, many, many years — and, to be honest, I’m not entirely sure I want to do it anymore. Engineering is a fairly thankless task and is, by and large, an unrecognised profession in England — although it does pay fairly well. Engineering is also a dying profession (at least in this country), nobody studies it at university anymore.

For anyone who doesn’t know what a PLC is, it’s a Programmable Logic Controller, or where Siemens are concerned, just a Controller, and they pretty much control just about every automated process in the world, from rollercoasters to water treatment plants; brewing, baggage handling, power stations, car production lines, traffic lights, chemical plants, I’d be willing to bet there is a couple on the space-station; I’ve even seen one play I’m forever blowing bubbles on a trombone it had an air compressor connected to the mouthpiece and a three phase motor driving the slide (engineering at its finest). If it’s got an electrical panel, it’s a fair bet it’s got a PLC inside it somewhere.

PLCs were invented in 1968 (I was just two, so I didn’t have a lot to do with it in those days) by Richard “Dick” Morley, the founder of Modicon, he called it the Modicon 084 (the number reflects the number of the project, it was the 84th project — Engineers are never lacking for imaginative names), here they are, Dick is on the left and the PLC in the middle. I’ve added a pencil to give a sense of scale.

Figure 1 - Richard E. Morley and friends with the Modicon 084
Figure 1   Richard E. Morley and friends with the Modicon 084

I’ve worked with PLCs in one form or another since I left university in the 1980s, although not, I’m sorry to say, the Modicon 084.

The first one I worked with was the Siemens S5-135U, it looked like this:

Figure 2 - S5-135U
Figure 2   Here’s one I made earlier — the pencil gives its scale

It was 20 years later than the Modicon 084, but you can tell it’s the same sort of thing (it was big and heavy, again the pencil gives a sense of scale).

And just in case you were wondering about me, here I am; standing up, third from the left, this was my first proper job just after I’d graduated from university, it was 1988, Margaret Thatcher was our Prime Minster and I was working for the National Nuclear Corporation with some of the cleverest people I’ve ever met (not that they were necessarily with me in this picture):

Figure 3 - The author in 1988, third from the left
Figure 3   The author in 1988, third from the left (the pencil is still to scale)

At the time we were working on a project called the European, Tritium Handling, Experimental Laboratory (Ethel for short) and it used S5-135U PLCs.

After a few years I had progressed to working directly for Siemens and started working with the S5-135U’s big brother the S5-155U (it looked virtually the same, but supported redundant processors). We were developing a system of X-Rays scanners to find bombs in airport baggage (it was after Lockerbie).

This is what we looked like back then, 1996 (the photo was taken on the roof of Gatwick airport — not sure what happened to the pilots who parked their planes there):

Figure 4 - The Author, second from the left
Figure 4   The Author, second from the left — Number 3 (sorry, no pencil this time)

The lady in the middle (no 6 in the convict line-up), Jane, later became my wife (well, second wife, but she was definitely a good one).

If you’re wondering what the significance of 93671 is, I can’t remember. I rang some of the other people and they couldn’t remember either (the best guess was that it was the number of slaves Siemens had working for them under the Nazi… No, stop, stop, stop, don’t go there!).

Anyway, back to PLCs, these are built in colour nowadays, and they’re a bit smaller (it’s the same pencil, a Staedtler No.2 HB, if you are wondering, and is still to scale):

Figure 5 - Modern PLC
Figure 5   Modern PLCs (this one’s shorter than a pencil)

So here I am a bored engineer, wondering what to do with the rest of my life (I’m thinking pig farming might be good).

Some years ago I started a small website with the intention of writing a few obscure engineering texts in the form of web based books that might have been useful to other engineers; needless to say I got distracted and ended up writing about HTML, CSS and how to make good websites; I also wrote at excruciating length about a version control system called, would you believe it, Git, (I also devoted some of the time to taking the piss out of people who use Linux— bit unfair perhaps, they’re such an easy target).

And I enjoyed it, it fired my flagging enthusiasm; I’ve always like writing, which is unusual for an engineer — engineers as a rule do not like writing, they view it as a chore, an inconvenience. They use unnecessary apostrophes, have an indiscriminate view of punctuation (which they consider to be largely superfluous), and a have a concept of grammar that starts with assembler language (it could be worse, it could be salesmen or project managers with their inappropriate personal pronouns, all that “how are your good selves” and their usual bollocks). But I like writing and I’m old enough and went to the type of school where they taught you to do it properly.

Taking stock, I realised that, over the years, I have written quite a lot of software for PLCs and even have a library of software modules that I developed and have used on various projects.

This library is a set of fully deployable software modules that is suitable for the control of most industrial process applications; it is the same software I use in my day job as an engineer.

It is currently in use on various live plants throughout the UK and in some other parts of the world and I have made a living charging people money to use it.

I am now making this software available to the you, dear reader, and to the world at large. I’m also going to explain (in excruciating detail) how it works, and why, from an engineering perspective, it is configured as it is.

“Why am I doing this?” you ask.

Well, it’s partly philanthropy, but it is also the fact that I should have written this stuff down years ago, and now I’ve started, I’m finding the process quite enjoyable and cathartic —and since engineering is a dying profession in England, I’ve decided to share my knowledge with anyone to whom it may be of interest.

I’m also getting old, and before I sink into my dotage and start dribbling into my porridge, I’ve decided to give something back; I’m passing on my knowledge and experience to the next generation of engineers (if there is one).

So you are free to use the software described here (you can even download my library of modules without doing any work at all)—yes, it is my software, yes, I own it, but I’m not going to sue anyone who uses it—fill your boots—I ask only that you are kind enough to credit me in your software (and if you find it useful, to possibly make a donation).

Bear in mind this is proper industrial software and has a degree of practical complexity appropriate for the environments within which it is deployed—this is not the simple “open a valve and fill a tank” software you find on PLC training courses—this is the real thing, it is proper engineering software, written by a proper engineer and to proper engineering standards. Use it wisely young Skywalker.

I’m going to do one other thing, I’m going to do this as a formal engineering project written and developed to the highest engineering standards, in the engineering lingo, it is a GxP project (GxP means good … something … practice, where the x stands for various things, manufacturing, distribution, engineering, cricketing &c. — sorry, not cricketing, just joking).

GxP projects comply with the standards and regulations required for pharmaceutical or medical applications and are generally the most rigorous standards used for PLC applications (what we will officially call “control systems”). The rigour is evident in the level of documentation, testing and software control required.

This is a GxP level project, the documents are the normal documents required by such a project and they are written to a high standard, I freely issue these documents as part of the library and they are a good template for all control system engineering projects. If you want to know how to write a User Requirement Specification, a Test Plan, or any of the other (many, many) engineering documents that go with a GxP project and what should be in them, read on to the validation section Section secNo.

To avoid any confusion (and, if I’m being honest, to avoid any liability) I’m making this software and all the associated documentation available under the MIT Open-Source licence. The MIT licence is a “permissive” licence; it is what most people think of when they think about open-source software. The licence is easy to comply with; essentially, you or your organisation need only reproduce the MIT licence and copyright notice, when using the software. Otherwise, you may do as you wish with the code, including modifying it, adding it to your software or just selling it. You must however, include the copyright notice.

I’ve included the licence (and an explanation of why I chose this licence) here.

Michael Gledhill
Chester—February 2025



End flourish image