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 13: Downloading to the PLC

Downloading to a Programmable Logic Controller (PLC) is an important and necessary part of any project. It is the point at which an offline project or modification is actually sent to the CPU. A download might consist of just software changes or also hardware changes. TIA Portal does a great job at managing this download process to ensure it occurs fault free. This chapter explores, in detail, how the download process works in TIA Portal and what is new in TIA Portal 17. Before making downloads to a PLC, it's important to understand the actions that TIA Portal needs to take and what this could mean for data in the PLC.

In this chapter, we will cover the following topics:

  • Downloading to a PLC
  • Retaining data in optimized and non-optimized blocks
  • Uploading from a PLC
  • Considerations

Downloading to a PLC

At some point, a download to the PLC is required to move the development code into the PLC runtime environment. When a download is initiated from TIA Portal, a sequence is initiated that compiles the project and checks the conditions for download. During this sequence, the programmer is prompted for actions (if any are required) and to confirm the PLC download action before the PLC is affected:

Figure 13.1 – The PLC download event sequence

The download sequence ensures that the PLC is up to date before any downloads occur.

Note

When the Download button is clicked on, a compilation of the hardware and software occurs. This means that if there are errors anywhere in the logic or the hardware configuration for the PLC being downloaded to, the download will not occur.

Initiating a download

There are multiple methods that you can use to start a download to the PLC; all of them initiate the same download procedure.

The most...

Retaining data in optimized and non-optimized blocks

When a PLC loses power, runtime variable data is lost and reset back to its default values, unless it is checked to be retained. Retained data persists after a power fail or a download to the PLC, and it only resets to its default values when a reinitialization occurs or a memory clear of the PLC occurs. If a variable needs to retain information, the Retain function needs to be selected in the corresponding data block or interface:

Figure 13.8 – The Retain checkbox

Figure 13.8 shows an example of four values set to Retain in a data block. Once the Retain box has been checked for some given data, the changes must be downloaded to the PLC. This will cause a reinitialization of the data.

Retaining data in instance data

Function blocks and associated instance data blocks can also have data retention set. However, there are more options involved, and it also depends on whether the function block...

Uploading from a PLC

PLC programs can also be uploaded out of the PLC and back into the TIA Portal project, which is useful if the version of the offline project does not match the project in the PLC:

Figure 13.19 – An example of an unmatching online project

The project tree will identify any objects that are not consistent with the online project. By right-clicking on an object and selecting the Upload from device (software) option, the Upload preview dialog box will open:

Figure 13.20 – Upload preview

The Upload preview window displays information about the upload that is about to take place and also asks the programmer for a decision regarding conflicting objects. A conflict is detected when a block that is different in the offline project has the same name as an object in the online project.

The programmer can choose the Action option, deciding to either Overwrite or Insert with different name.

Once the Action...

Considerations

Managing downloads can become more difficult the larger projects become, especially if the process that the PLC is controlling is also critical and PLC downtime is to be kept to a minimum.

Data segregation

A good method of reducing the effect of reinitialization and the chance of it needing to set the data in your project to the starting values is to segregate data into more than one data block:

Figure 13.26 – An example of segregating data

By grouping data into singular data blocks, where the data has something in common with the data it is grouped with, reinitialization only affects data that is grouped together.

Figure 13.26 shows an example of mixed data in DB1 on the left-hand side. If a variable was added, removed, or modified in this data block, the entire data block would be reinitialized. Then, groups of unrelated data would be set to the starting values.

By splitting the relative data into three data blocks, only...

Summary

Downloading to a PLC is a fundamental part of PLC programming. However, it is often considered to be a simple click of a button. This chapter has highlighted the important aspects of the download process that are often overlooked, such as the retention of data and methods to keep offline and online projects in synchronization.

TIA Portal always warns programmers of impending changes and will often require the selection of an action in order to proceed. It is important that habits are built by programmers to check the warnings and messages to ensure that the changes about to be actioned are understood.

In the next chapter, we will focus on the same principles, but for an HMI. This includes the configuration of connection parameters, downloading to hardware, and other important considerations.

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