Retrieve FC after over written

Ranjith

Member
Join Date
May 2007
Location
Melbourne
Posts
316
Hi Gents
I did a terrible mistake.
Copied 2 FC's from a different project to the existing one.
Accidentally press the over write button and I lost at least couple of weeks work in 2 seconds. Is there a way to retrieve the old FC? Haven't done a backup or never downloaded the program to a cpu since this code is for a new machine.
This must have happened to someone before and hope there is a way to retrieve it. Any help is much appreciated.
SIEMENS STEP 7 V5.5
 
Not that I know of, I've done the same in Step 7. Now, for any s/w, I have a backup for everyday I work on code; delete stuff older than a week every couple of days.
 
Please check your PM.
Sent you a link to the archived file on drop box.
FC's in question are FC102 and FC103 in PLC7301 Control.
Copied FC101,102 and 103 from another project.
There was no FC101 in the current project, so it copied OK.
Then FC102 and 103 replaced the existing ones.
Is there a way to retrieve the old FC102 and FC103.
Thanks for your help again.
 
Have you by any chance installed some software recently? You might be lucky and Windows made a restore point that might (or might not) include your old code.
 
The code for your FC's prior to overwriting them is stored in the data files within the S7 project. I have seen multiple copies of code/interfaces/comments when digging around S7 files with a Hex editor. Here's an example that shows that the code is present. I created two libraries both with an FC1 containing a single line of code. Library X loads DW#16#22222222 and library Y loads DW#16#11111111

Here's the Hex editors view of the code shown for X

r2.JPG
 
I copied FC1 from Library Y to Library X, ovewriting the FC.
The HexEditor reveals that both copies of the FC are present, the original at offset 600 and the new at offset 2400:

r3.JPG
 
The interface and comments for both versions are also located in the DBT file.
So.... it looks like it would be possible to wade through your SUBBLK.DBT file and by a process of elimination find the code the corresponds to the overwritten versions of your FC's (by coping each FC individually to another empty project and inspecting the DBT file to show the code).
Wether you want to take this on rather than re-writing is your choice, I'd go for the re-write myself.
 
Thanks L D[AR2,P#0.0]
I can see your point.
In S7Proj there are 9 folders (00001-00009) in Offline folder.
Each folder has a subblk.dbt file.
But only one dbt file has yesterday's date stamp in folder 00002.
I have zipped the whole folder and attached here.
I have not open it with hex editor yet.
I will keep you updated.
Thanks again for your help.
 
This FC was copied multiple times from project to project and I can see the tag names and network comments in the hex editor right hand side column.
Most importantly I can see the logic I needed to retrieve as well.
Now It's just a matter of moving the stuff I need into the right area in the hex editor. I am trying to workout a pattern,

As per your test offset 2400 is the current logic and 600 is the old logic.
So if you move the numbers in 600 to 2400 then it should represent the old logic.
 
Have you by any chance installed some software recently? You might be lucky and Windows made a restore point that might (or might not) include your old code.


I haven't installed any software since then.
I think the restore will only modify the system files.
I have few restore points prior to disaster.
Is it worth trying?
 
A data base editor looks more promising. I have found what appears to be the previous versions of blocks using DBF Viewer 2000.

dbf.jpg
 

Similar Topics

we have lost the HMI Panel View source file (.apa) we do not have back either. we have only .PBA file. can some one help how to get .apa source...
Replies
2
Views
1,139
We have many CISCO and STRATIX switches in our process network. The Stratix switches have AOPs that enables us to use our Rockwell PLCs to gather...
Replies
8
Views
2,218
Hi, I started my journey with Micro820 and I have to read input status address 10001-10010 from one device via Modbus TCP, everything works fine...
Replies
0
Views
1,184
I'm headed to my shop right now to try an experiment. I'm trying to find out if the PowerFlex 700s can swap control boards and successfully power...
Replies
8
Views
2,571
Hi All, I am writing a piece of software for some research and would like to retrieve a running program from a PLC using python or some other...
Replies
5
Views
1,994
Back
Top Bottom