Reader small image

You're reading from  PLC and HMI Development with Siemens TIA Portal

Product typeBook
Published inApr 2022
PublisherPackt
ISBN-139781801817226
Edition1st Edition
Right arrow
Author (1)
Liam Bee
Liam Bee
author image
Liam Bee

Liam Bee has worked in automation for over 16 years, after starting his career at 16 years old as an instrument technician in the water industry. He began his automation journey by maintaining PLCs and the instruments connected to them. He found very early on that he had an interest in PLCs and automation, taking the time to learn PLC programming in his own time, as well as exposing himself as much as possible to automation while working. After 8 years of working in maintenance, Liam started his own side business, providing bespoke controls using lower-range PLC solutions. This experience proved invaluable to his progression; he learned quickly, often through failure, and his knowledge of control design improved significantly. 12 years into his career, he moved roles again; this time, he was looking for something to fill knowledge gaps and target Siemens as he was yet to use Siemens extensively. Liam started at Aquabio Ltd and quickly found himself immersed in Siemens SIMATIC Manager and TIA Portal. Over the next 3 years, he worked hard to understand Siemens' tools and development environments, calling on knowledge from other PLC environments that he had previously worked with. Over his years working with automation, he has learned many different languages and development environments. He has worked with Siemens, Allen Bradley, Schneider, Mitsubishi, and a host of other PLC platforms, all of which have helped shape the design concepts that he uses today. Liam has also taught himself computer programming languages such as VBA, VBS, VB.NET, C#, Java, and more. Closing the space between IT and industrial automation is important as time moves forwards and he has always tried his hardest to be at the forefront of innovation.
Read more about Liam Bee

Right arrow

Chapter 4: PLC Programming and Languages

While the previous chapters have explained how structure helps build a strong foundation where data can be managed effectively, the next few chapters will focus on PLC programming and the various languages that Siemens offer in TIA Portal.

Without understanding at least one of the many available languages, a programmer will find it difficult to create an executable program. This chapter explores the different languages available in TIA Portal, including the new Cause and Effect language that was introduced in TIA Portal version 17.

After reading this chapter, you should know the following about each available language type:

  • The language's basic composition (graphical, text-based, and so on)
  • Common use cases

The following topics will be covered in this chapter:

  • Getting started with languages
  • Selecting the best language for the task
  • Differences between Siemens and other PLC vendors

Getting started with languages

PLCs can be programmed in a variety of different languages and different PLCs from different manufacturers may implement slightly different variations of those languages.

Not all PLCs support multiple languages, and the ones that do support more than one language do not necessarily allow for that language to be fully implemented. The general correlation between PLCs and language support comes down to cost – the more expensive a PLC is, the more likely it is to support more than one language type.

Note

Siemens PLCs, when programmed with TIA Portal, support multiple languages, even at the lower ranges.

Available languages

Before you select a language for the task at hand, it's important to know what is available and what that may mean for the project that's being developed.

LAD – ladder logic

Ladder logic is a graphical language based on contacts, coils, and instruction blocks.

Figure 4...

Selecting the best language

It is important to understand that there is no right or wrong language when it comes to programming a PLC. However, there are strengths and weaknesses between different languages. There are times when choosing a particular language over another has its advantages.

The best approach is to look at what is trying to be achieved, both now and in the future, and create a block in a language that fits those needs. A PLC project will generally fair better with mixed languages that fit the needs of the project rather than sticking with a sole language and struggling through areas that are difficult to program.

Understanding the use case

Every block in a project has a use case. This relates to the following:

  • What the block has been developed to control/manage
  • How the block fits in with other blocks
  • Who is using/maintaining the block

These simple statements help us understand the best language to implement when designing a block.

...

Differences between Siemens and other PLCs

Languages in Siemens closely relate to those of other major platforms. Ladder, FBD, SCL (or ST in most other environments), and STL are all ultimately the same. The other languages are either unique to Siemens or have noticeable variations compared to other environments. Despite the most common languages being the same for the most part, there are a few things to watch out for that are subtle and not immediately obvious.

Timers

In TIA Portal, when an IEC timer is used (TON, for example), everything appears normal compared to other IEC environments.

Figure 4.16 – TON timer in TIA Portal

However, if the PT value is changed while the IN input is True, Timer does not respond to the change until the IN input has become False and then True again. This is not immediately obvious and is not the expected behavior compared to other environments.

TIA Portal has a solution to this, which is to place a PT Coil before...

Summary

You should consider different languages and use cases when you're developing logic blocks. This chapter has introduced all of the available programming languages that TIA Portal offers programmers and explained where they can be used. It also provided an overview of what they look like and how they are used.

This chapter should have helped you appreciate the different languages and what they can offer an overall project.

The next chapter will expand on this by providing more detail on the languages mentioned here and how to program them. A basic sand filter cleaning sequence will be programmed in each of the languages (where possible) to demonstrate how to construct a block in the respective language and what issues will be encountered.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
PLC and HMI Development with Siemens TIA Portal
Published in: Apr 2022Publisher: PacktISBN-13: 9781801817226
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Liam Bee

Liam Bee has worked in automation for over 16 years, after starting his career at 16 years old as an instrument technician in the water industry. He began his automation journey by maintaining PLCs and the instruments connected to them. He found very early on that he had an interest in PLCs and automation, taking the time to learn PLC programming in his own time, as well as exposing himself as much as possible to automation while working. After 8 years of working in maintenance, Liam started his own side business, providing bespoke controls using lower-range PLC solutions. This experience proved invaluable to his progression; he learned quickly, often through failure, and his knowledge of control design improved significantly. 12 years into his career, he moved roles again; this time, he was looking for something to fill knowledge gaps and target Siemens as he was yet to use Siemens extensively. Liam started at Aquabio Ltd and quickly found himself immersed in Siemens SIMATIC Manager and TIA Portal. Over the next 3 years, he worked hard to understand Siemens' tools and development environments, calling on knowledge from other PLC environments that he had previously worked with. Over his years working with automation, he has learned many different languages and development environments. He has worked with Siemens, Allen Bradley, Schneider, Mitsubishi, and a host of other PLC platforms, all of which have helped shape the design concepts that he uses today. Liam has also taught himself computer programming languages such as VBA, VBS, VB.NET, C#, Java, and more. Closing the space between IT and industrial automation is important as time moves forwards and he has always tried his hardest to be at the forefront of innovation.
Read more about Liam Bee