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 5: Working with Languages in TIA Portal

This chapter uses a common scenario to explore how different languages would approach the logic and control of the scenario.

Working with different languages presents different challenges at different points of programming. Understanding where languages have strengths and weaknesses with a comparable scenario will help programmers learn quickly when to mix and match code.

In this chapter, we'll cover the following main topics:

  • The control scenario
  • Languages used in TIA Portal

After reading through the chapter, the following languages will have been used in programming for the provided scenario:

  • Ladder Logic (LAD)
  • Function Block Diagram (FBD)
  • Structured Control Language (SCL)
  • GRAPH
  • Cause and Effect Matrix (CEM)

Each of the preceding topic areas will be examined against a control scenario. An overview of the basics of the languages and instructions are provided before a walk-through...

The control scenario

This chapter focuses on a control scenario for a basic sand filter. The scenario is simplified enough that the control aspects are simple but enough of the languages is explored to understand how to use them and demonstrate strengths and weaknesses.

The languages explored in this chapter will be used for the following control scenario:

Figure 5.1 – Chapter control scenario

The flow control diagram in Figure 5.1 demonstrates a simple method to relay how the controls are expected to operate for each of the languages used in this chapter.

A graphical representation of the process is available via a Comfort Panel Human Machine Interface (HMI).

Figure 5.2 – Graphical representation of control system

The liquid to be filtered enters the tank from the left, through the Inlet Valve and exits the tank after passing through the filtration media via the Outlet Valve. The instrumentation consists of a Tank...

Languages used in TIA Portal

This section covers five of the languages available in TIA Portal and demonstrates their usage against the control scenario.

Ladder logic

LAD is the most popular language in the PLC control space. It's likely that programmers of PLCs have never seen or used LAD. Although it's still extremely popular, other languages such as SCL are also becoming very popular.

Overview

Ladder gets its name from the way that the logic flows from the left of a network to the right of a network. When multiple networks are placed in series, a ladder is formed.

Ladder, like other languages that are programmed in networks, is processed as follows:

  • Networks
    • Top to bottom
  • Logic inside networks
    • Left to right.
    • Top to bottom.
    • Conditions that come to a common point (the closing of a branch) will evaluate all conditions left of the common point before proceeding.
    • Outputs/instructions that are on open branches will be processed top to bottom from the point...

Summary

This chapter has explored a wide variety of different programming languages and techniques. Programmers who are capable of leveraging all of the available languages will find that they are more flexible with the approaches that they have at their disposal.

It is important to understand the differences between the languages and what the strengths and weaknesses of each language are. Writing a project in a language that doesn't best suit the control requirements can significantly increase the time required to develop, test, and maintain the project.

While different languages exist, in most cases, it is still possible to achieve what is required in any language (CEM excluded).

This chapter, along with the provided project, should have helped you gain insight into each of the available languages, how to write basic logic, what each language looks like when monitored, and what the strengths of each language are.

The next chapter introduces standard control objects...

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 $15.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