Problems with Siemens S7 file management

BobTheBlob

Member
Join Date
Dec 2015
Location
Ontario
Posts
7
Hello.

I appreciate the insights here and the willingness to share. I've got a lot of Rockwell experience, but my Siemens experience is relatively limited and in the somewhat distant past. On a new job assignment now and having trouble getting "useful" S7 archive files for an easy restoration in the case of a catastrophic failure.

This is the issue I'm having.

I have offline project archives for active PLCs we are running here. When I open these archives and do a block comparison, I typically find some blocks newer in the archive than the PLC, and some files newer in the PLC than the archive.

Because I don't know what I have throughout, I thought the best approach was just to take any blocks that have a mismatch and copy them from the online project (PLC0 to my offline (laptop) file.

But the problem now is that it seems when I open blocks with calls to DBs that were built with descriptors(?) (or labels?) in them (in the "Name" column of the DB) I get a mismatch error.

1710943282368.png

I'm thinking here that when the DBs are loaded from the offline to the PLC, those names don't get passed to the PLC. Is that correct? So the data structure is passed to the PLC but the symbols are not.

The problem is twofold: (1) when I open an FC that has addresses from those DBs, the names are "not available," so I need to click on those spots to even get it to work. But the other problem is that I need to get those descriptors in the archive, or else how do I keep this stuff all aligned so we don't lose those descriptors built into the DBs for the sake of having a harmonized archive file?

The problem is also that I'm reluctant to just dump the "newer" (offline) blocks into the archive, because I'm not yet familiar with what it will do to the data stored in the existing blocks, or the program as it references them, etc, etc, because I'm also still learning the process and the machines here and some are a little complex.

What are best practices for getting these files into a useful archive state? Is there any way to get the data from the blocks in the PLC into the "newer" data blocks in the offline files? Does it make any difference?

Also, if a DB is loaded to the PLC, do those descriptors actually get copied to the PLC? Or is it just the data structure that gets copied to the PLC and those descriptors only ever reside in the offline file? (They look like they are what is used if programming by symbols. But I'm not sure yet how this stuff works.)

Thanks in advance if anyone can help or offer suggestions or any articles or resources.

Feeling a little overwhelmed and the help is appreciated.

Regards,

"Bob" (feeling a little blobby...)
 
Long time since I did S7 however, the problem is probably due to the DB info i.e. time stamp is different (I think it can happen if the offline project is saved again without downloading) also if you upload the DB's from the PLC it defaults to no structure, I believe the way to do it is open on-line & off line projects & drop the on-line DB's to the off line project (I think this is the way but not sure). It was a problem on the older S5 where if you just uploaded the blocks the structure was ovewritten. I'm sure someone here with more recent experience will put you right.
 
It's fair to feel overwhelmed by this; it's not a straightforward thing. I went through a lot of processes trying to make sure I had a reliable way to reconcile projects when online and offline don't match. If you download a DB, it will overwrite the active values in the PLC, so you don't want to do that.

First: you may be able to take the project with problems and rebuild or recompile it (don't remember the terminology). That sometimes sorts out issues like this. You can also try to copy the symbols table from the original project to the new one.

Second, if the comparison results window shows green (code matches, just a time stamp variation), you're good.
Third, there's a checkbox to hide datablocks with different actual values. If you hide different actual values, and all of the other differences are only time stamp variations, then your archive is good and you don't need to do anything unless you want the actual values to match. if so, that's a relatively simple process.

Here's the process I came up with (not necessarily the officially approved Siemens method, but what seemed to work for me) to save actual values, assuming the structure/code match. Frankly, the "official Siemens way" when I asked them for support was just "don't mess up the archive".... :rolleyes:
Note which DBs have different actual values
1) Open OFFLINE DB
2) Click "Open Online Partner", click "OK"
3) Go to Data view. Make sure symbol names are present
4) Click "Save"
5) Click "OK" to allow overwrite (if prompted)
This saves the current online actual values to the offline archive

OR, if DB structures perfectly match:
1) Open ONLINE project
2) Copy DBs from ONLINE to OFFLINE.
3) Verify Symbols & Names still exist

If you have a structural variation in the instance DB of an FB...definitely not good. I tried a bunch of things that didn't work when I encountered a situation where the system had been changed by someone who was no longer with the company and whose laptop had been wiped. The online DB had an older timestamp than the archives we had. I never came up with a "good" way to reconcile it since it was in the FB definition. My last idea that I never had a chance to try (it was a big DB and I had a lot of time constraints) was to brute force transcribe the current online values into the offline file and then download the offline into the PLC after reconciling the FB declaration.

My procedure to reconcile a differing hardware configuration may be helpful as well:
Hardware Configuration reconciliation (assuming your archive has matching code blocks)
1) Create new, empty project (called in this case BlastWash01_Upload)
2) From within the project, select "PLC -> Upload Station to PG..."
3) In the "Select Node Address" dialog, type in the target IP address and select the rack
and slot numbers ("0" and "2" respectively in this case). Click "OK".
5) You now have whatever is in the PLC
6) Just to verify, open the Hardware Configuration and go online. Make sure you do NOT
get the error message. If no message, you're OK. Close the Hardware Configuration.
7) Select the "Blocks" folder. Right-click, and select "Compare Blocks..."
8) Select "ONLINE/Offline" and "Execute code comparison". Click "Compare"
9) In the "Compare Blocks-Results" window, select "Hide data blocks with different actual values"
10) What's left should be blocks with differences. If the list box is empty, you're OK.
11) We now have a project with the correct Hardware Configuration, but without symbols & comments.
12) Select OBs, FBs, FCs, DBs, UDTs, and VATs. Copy them from the old archive to the new project.
Leave the "System data" and any SFBs alone!
13) Copy-Paste the Symbols table from the old archive to the new project.
13b)Open the Sources folder, and copy-paste any contents from the old archive to the new project.
14) Verify again the code blocks and Hardware Configuration. Open a few blocks to verify the symbol
information is present.
15) Copy-Paste the WinCC Flexible project(s). This can be a SLOW and PAINFUL process (took over an hour this time)
15b)Copy-Paste Sinamics objects. These are NOT uploaded with the station**
15b.2) If the Sinamics objects are the incorrect version, you must open them (with conversion enabled), then save & compile
before copying.
***This will prevent you using this project to go online with the drives in the future!!
16) Verify again the code blocks and Hardware Configuration.
17) Save the project with a new name: BlastWash01_20120320 in this case
18) Verify again the code blocks and Hardware Configuration.
19) Archive the project, then close and delete it.
20) Retrieve the project.
21) Verify again the code blocks and Hardware Configuration.
22) All is well (for now)

If your global DB structure doesn't match, you may be able to copy the online DB into the offline file and then copy the symbols table (as above).
 
Hi Bob.

Quite simply the archived project does not include the latest changes that was made to the PLC.
Someone failed to create an archive and save it to the server.
It is extremely important that you have a strict regime of backing up any program change immediately.

Before going online with any PLC, always perform the offline/online comparison.
Deselect that differences in actual values are flagged as differences in the program blocks (I dont remember exactly what the setting is called *). This can flag DB blocks as different even if they are in reality not different.
Only if no differences are found, can you proceed normally.
There are situations where you can simple drag and drop program blocks from the online to the offline projects, but I do not recommend it.
If the unfortunate happens that differences are found then do the following:

Rename the offline project with a new version no.
You will work on this program version to try an syncronize the offline and online programs.

If only 1 program block is found different, in the comparison view select the block and select Go To Block. You will presented with the code editor with the block open in both offline and online views. This hopefully points you to the exact spot where the difference is.
edit: In this view there are arrow buttons to jump from one found difference to the next. If there is only 1 rung with a difference, the arrow buttons will not appear.
You must then decide what to do, keep the online change or discard it. If you decide to keep the online change, carefully copy the changed rung(s) in the online block and paste it(them) at the correct locations in the offline block. Only in this way do you not mess up the rung comments.

If more than 1 block is different, create a new project and perform an Upload station to PG.
Then perform an offline/offline comparison between the renamed project and the uploaded project.
Perform the same meticulous block comparison and evaluation as before. For each difference that has been found you must figure out the reasoning behind the difference and decide to keep or discard.
When all differences are dealt with in the offline project, load again to the PLC. This will syncronize the timestamps so you can go online, also for the blocks for which there were no differences.
If structures have not been changed in the DBs, it can be possible and maybe desirable to NOT load these DBs. In this way the online actual values will not be overwritten.

When done, archive the project to the server !!

*: Found it. When the comparison result is displayed, there is a selector to 'Hide data blocks with different actual values'. This is by default not set. Set it to filter out the DBs that are different only because of the actual values.
 
Last edited:
Thank you everyone for the feedback. Much appreciated.

I will go through all of this and see where I end up. But for now, I think you've probably covered it all!

THANK YOU!
 
OK......

I appreciate the feedback. I went through and commonized files into a new copy of the original project to keep track of it as a separate project from the original.

I managed to do a good file compare and I did get things contained to where I now know it would run from a download of the latest to a clean PLC in the event of a disaster.

I THINK......

But not quite sure. Now, when I check block consistency, i'm getting this:

1711469173871.png

What, exactly, might this be telling me? And should I be worried? Its what comes up doing a consistency check on the latest one which has all the blocks copied that match what is in the PLC.

Ideas on what this is telling me and if I need to be worried or not?

Thanks.

"Bob"
 
By the way, I thought I had run the "compile all" but that wasn't the case. In the "check consistency" window, I saw the instruction there and did it "again," and now it compiled, down to a few errors.

Some symbols to chase now: not sure where they come from. Going to go online again to see if I can identify them online (vs offline file) to recreate symbols or something.
 

Similar Topics

I currently have 4 siemens mp277 10 inch touch screens I deal with. Lately 2 of them have been giving erratic touch screen results. To specify...
Replies
7
Views
1,788
Hello , Can you please have a look at the code in the attached file and say why it isn't working? The piece of code is ' copy@paste' PID from...
Replies
2
Views
1,326
Hi all I have a cpu314c with a 5ai/2ao unit, I can’t get any reading within my program. I have tried with the simulator and the program works...
Replies
8
Views
2,346
HI, I'm running TIA Portal V13 SP1 Update 9 on a virtual machine, but having some issue with TIA Portal crashing. I'm just wondering if someone...
Replies
4
Views
3,433
Hello! Im having some urgent problems. Im in need to move my recipes to the MMC card. The problems im having here is that when i use the...
Replies
22
Views
4,375
Back
Top Bottom