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 2: Creating Objects and How They Fit Together

This chapter explains how, when creating objects, programmers should be mindful of how the hierarchy in TIA Portal operates. It helps programmers understand how to create a project's structure, how programming objects work with each other, how different instances of data in different spaces affect the project, and how interfaces that contain objects work.

We will cover the following topics in this chapter:

  • Creating a project's structure
  • Hierarchy in TIA Portal
  • Instance and global data
  • Interfaces and the effects of running PLCs

Creating a project's structure

When a new project is started, there's usually a good idea of the direction the project will take, such as whether control elements for equipment such as pumps will be added, what parameters will be created, and how data will be sent to and from a SCADA system. This information makes up most of the project, with logic and control only possible once the required assets and parameters have been established.

It is generally a good idea to enforce a workflow or project structure when developing with TIA Portal (or any PLC vendor). Being able to map out exactly where actions such as data exchange take place and where control logic takes place helps visualize a project, especially if the project that's being developed is large.

Data management

Data management is important in TIA Portal and Siemens has taken a very strong approach to ensure that the data and program cannot be compromised in an online environment (due to modifications...

Hierarchy in TIA Portal

TIA Portal works by using a parent/child hierarchy, where parent objects call child objects that they depend on to function correctly. The following is an example of a parent/child hierarchy:

Figure 2.9 – Example of a parent/child hierarchy within the example project

The preceding diagram shows how the Pole_Lights function block is dependent on Pole_Light_Manager. If Pole_Light_Manager is modified, then the Pole_Lights function block would also need to be modified to utilize the new version. This is because the interface of the Pole_Lights function block would need to change its size to accommodate any new data that's added to Pole_Light_Manager.

This example also shows that input mapping and output mapping do not have any dependents, so they do not rely on any other function blocks or functions to process their logic.

Call structure

In TIA Portal, a view window can be opened that displays the call structure. This...

Instance and global data

As with most PLCs, TIA Portal has two types of data – global and instance. What defines the data as a particular type is where and how it is used. What is classed as global or instance data depends on what information is being held and how it interacts or interfaces with logic:

  • Global data:
    • Data that can be accessed anywhere in the project, at any hierarchy level.
    • Data can be freely defined by the programmer, including the creation of sub-structures that contain data or UDT definitions.
    • It cannot hold instance data for a function block, even in a sub-structure.
  • Instance data:
    • Data that exists explicitly to be used with a function block or UDT.
    • Data is automatically defined by the requirements of the function block/UDT it is associated with.
    • It will contain any sub-instances of function blocks that have been called within the parent function block.

      Note

      There is an additional global data block type called Array DB. This allows a data block to be explicitly...

Interfaces and the effects on running PLCs

The different configurations, types, and combinations of interfaces affect not only the behavior of the PLC but its performance. It is important to understand that a poorly configured data management system will result in poor PLC performance.

One of the biggest factors of this in TIA Portal is whether data is optimized or not.

Optimized data/non-optimized data

The concept of a PLC optimizing its data is not a new one. There are many PLCs that do this all the time, but Siemens has allowed programmers to choose if they want an object to be optimized or not.

Note

By default, all objects that are created in TIA Portal have optimization enabled.

Differences between optimized and non-optimized data

The main difference between optimized and non-optimized is the amount of memory that's used to store information. The following diagram shows the difference between how data is defined in a data block and how it is represented...

Summary

This chapter covered the fundamental requirements for structuring and managing the data that's used throughout a project. We have highlighted that TIA Portal is a hierarchical development environment and that changes to dependency objects will affect objects that depend on them. This can ripple through a project and affect any object.

We also learned about global/instance data and demonstrated that these data types are at the heart of data management and that we should consider how they are used throughout a project. After that, we learned about optimized and non-optimized data and highlighted how it affects a project and how it may or may not be suited for the application you're designing. Remember that how data is passed through the interfaces of program blocks can make a big difference to the efficiency of the PLC's runtime.

The next chapter builds upon the lessons we've learned regarding structure and hierarchy. We will introduce the concept of...

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