Differences between an offline and online project, due to modifications being made

Making changes to a project is an everyday aspect of PLC programming, especially during commissioning or fault fixing.

When it comes to making changes, the key consideration should always be: Is It Safe.

There are many different things that can trip you up and either cause undesirable effects or lose valuable data in your application.

Here’s a few things that have happened to me after doing downloads to a running system (I learnt the hard way!):

  • Lost months of data for flow totalisers and hours run on package plant systems not connected to a SCADA machine
  • Accidently set a sequence step number to a mid-sequence point, causing damage to equipment after a pump started against a closed valve
  • Flooded a car park after modifying a pumpset system and making a mistake in the logic
  • Flooded the same car park again the next day with a similar mistake….

What I’m trying to say is that mistakes are easy, especially when your experience and exposure to modifications is low (as was mine at the time!)

Although mistakes teach you faster than anything else, it would still be wise to avoid them.

This article explains some of the things to be careful of when making modifications in Siemens TIA Portal

Understanding What Exactly Is Changing

Load Preview window in Siemens TIA Portal

TIA Portal isn’t very transparent with what exactly is changing, what’s being Reinitialized and what any dangers are when performing a download.

The above image shows the Load Preview window. This window is vital to understand what exactly is happening in the download process

For some reason, Siemens decided that hiding the important information under drop-down sections was a good idea. Make sure you expand these and check what exactly is being overwritten.

The Data Block re-initialization is the most important part here, we’ll cover what that means exactly in a moment, but if an action is required and re-initialization is occuring, it’s a good idea to expand the Software and Overwrite Online? sections to see what exactly is going to be re-initialized

Re-Initialization

Re-Initialization occurs when data has been modified and grown larger, or smaller than the online version in the PLC.

When this happens, the PLC needs to allocate new memory areas to accommodate the changes. This means shuffling the start point of the data to somewhere new in the PLC’s available memory and allocated a whole new area.

In doing this, the system cannot retain the original information. Unlike older SIMATIC Manager systems, where extending a Data Block would not result in losing information, TIA Portal is unable to keep the symbolic links to the variables intact without re-initializing the values back to the start values.

This can be really problematic for sensitive systems or systems that track data over long periods of time, since the data will be overwritten with that of the value in the start value column:

Example of Start Values that will be written in the case of Re-Initialization

The above image shows that in the event of Remote_Interface being re-initialized, the Total_Time_Active for the two systems will be re-initialized to their respective Start values.

Note
Note
Note

So at this point, we know the following:

  1. Changing data sizes (or even names of tags in TIA Portal) will cause a Re-initialization
  2. Start values are loaded in the event of a Re-initialization

But what can be done to ensure we don’t lose any important data. And in doing so, how can we ensure that we don’t capture things we don’t want to accidentally set to a value?

Snapshots -> Start Value

TIA Portal has a tool called Snapshots, where by the values of a Data block are stored in an intermediate location within the block:

Button that starts the Snapshot procedure

Once the Snapshot button has been pressed, TIA Portal saves the current value into the Snapshot column:

Snapshot taken and stored

We can see that the Start Value, Snapshot Value and Monitor Value are all different in this case.

At this point, if the PLC were to be re-initialized, the Start Value would be loaded into the Monitor Value as the latest data and the Snapshot data would not be used.

TIA Portal has another tool here:

This allows the copying of Snapshots to Start Values, which essentially creates protection against re-initialization.

This means that if you:

  1. Perform a Snapshot
  2. Perform a Snapshot -> Start Value
  3. Make your modifications
  4. Download and re-initialize

Your data is still safe and will move with the re-initialization.

There are some considerations though… You need to make sure you are capturing and updating variables that matter and not accidently updating variables that shouldn’t be changed directly…

Setpoint Data

Whilst this is great, the Snapshot feature captures everything. This may include things that you simply do not want to include. This may be things such as:

  • Current sequence steps
  • Current mode of operations for assets (Hand mode for example, or Jog mode of a pump)
  • Alarm statuses
  • Interlock conditions

All of these may cause an unexpected issue with your logic as values suddenly change to those of a snapshot taken months ago.

TIA Portal has a Setpoint column, which allows you to flag a variable as a “Setpoint”

Setpoint column shown, with Total_Time_Active selected as a setpoint in both systems

This then opens a new option when saving Snapshot data to Start Values:

Only Setpoints

The highlighted button in the image above is the Only Setpoints button, and copies only the variables marked as a Setpoint to the Start Value.

By maintaining good practice at setting what should be a setpoint and what can safely be discarded, you can ensure that nothing unwanted is saved into the Start Value and inadvertently entered upon re-initialization

Snapshot to Start Values, but only Setpoints have been updated

The above image now shows that only the Setpoints have been updated – Note that no other variable other than the Total_Time_Active have a Start Value entered.

Considerations

The above only really works if you follow a discipline that is:

  • Always ensure you set the Setpoint check on any variable that should be Snapshotted and moved to Start Values
  • Always ensure you only ever use the Only Setpoints option when moving Snapshot data to Start Values
  • Ensure you take a Snapshot BEFORE you start any modifications
    • Once modifications start for block, snapshots are disabled!

Check Out Another Post

Leave a Reply