Siemens Step 7 file & folder structure

OPC_Eng

Member
Join Date
Jan 2010
Location
AB
Posts
8
Hello,
I am working on developing an application that needs to import symbols from a Siemens S7P project but I am getting a bit confused with the s7p project folder structure. Are there any documentation anywhere that would explain the dbf files in the project folders?? any help will be very much appretiated. What I observed so far is that the starting should be at ..\hrs\s7resoff.dbf .. I am guessing I need to link the information obtained from that file to another file somewhere and so on but I still have no clue where to go next
 
Last edited:
As far as I now, there is no an easy way to get symbols from dbf files. But, if you open your project in the Simatic Manager and open symbols (symbol table) in Symbol Editor, you can select all symbols ( Edit / Select / All or Ctrl_A) then copy (Edit/Copy or Ctrl_c) the selection to the clipboard. After that you can paste it from the clipboard into some spreadsheet. You'll get something like this:
moz-screenshot.png

LL12ks22 M 245.3 BOOL description
LL12ks23 M 245.4 BOOL description
LL12ks24 M 245.5 BOOL description

I hope there is a way your application can use data from the spreadsheet.
 
You can also export the symbol list to 4 different file formats. One of these is the old S5 symbol list format (*.SEQ). This is a simple readable text file. And in the case you already have an application which can read S5 symbolic lists, you can use that one on the SEQ files too.

Kind regards,
 
Is the application an OPC client ? (your handle certainly hints towards that ;) )
In that case, and if you are using Simatic Net as the OPC server, then you can select to "use symbols" in the setup of the OPC server. The symbols will then be automatically included when browsing for OPC tags.
 
Working with the internal files of Step7 project will take you a little bit. I work for Siemens and I have asked Germany about project files as well and they have refused to give any info.

You may ask at the Siemens Support Forum and see if someone in there can give you any hints.

http://www.automation.siemens.com/W...=en&siteid=csius&extranet=standard&viewreg=WW

You can also export the symbol list to 4 different file formats. One of these is the old S5 symbol list format (*.SEQ). This is a simple readable text file. And in the case you already have an application which can read S5 symbolic lists, you can use that one on the SEQ files too.

Kind regards,

One of the formats is a (*.DIF), you can open that file with Excel, edit it and then reimport the file to Step7 with the added symbols.
 
Last edited:
Hi,
I figured out some details of the dBase structures of a Step7 project, but it seems all very complex and confusing.

Nevertheless I got how to get the symbolic table of a S7-Program.
I use Perl with a dBase module to read out the database files. Then you can use standard SQL queries to walk through the database.

# List S7-Program folders:
SELECT NAME, ID FROM S7RESOFF

# Choose the ID (=xxx) of the program-folder and
# get the link ID from YLNKLIST
SELECT SOI FROM YLNKLIST WHERE TOI = xxx

# The result (yyy) is the linkage between SYMLISTS and S7RESOFF.
# Get the subfolder of symbolic table
SELECT _DBPATH FROM SYMLISTS WHERE _ID = yyy

# you get the subfoldername of the symbolic file (\YDBs\zzzz\SYMLIST.DBF)
# then read the symbolic table Step7-Manager-like with
SELECT _SKZ, _OPHIST, _COMMENT FROM SYMLIST
 
Thank you guys for all the information. I think the information about s7p files in that thread is more than the total of what I found in any other forums. Please reply if you have any more info about those files. What I am doing is some devolopment in an OPC server that connects to the siemens PLCs and I am trying to add the feature to read the s7p files same as other applications that connect to the PLC.
 
Thank you guys for all the information. I think the information about s7p files in that thread is more than the total of what I found in any other forums. Please reply if you have any more info about those files. What I am doing is some devolopment in an OPC server that connects to the siemens PLCs and I am trying to add the feature to read the s7p files same as other applications that connect to the PLC.

Do you know an OPC-Server which reads the Step 7 project files?

Or do you mean the PLC "browsing" you can do with the Simatic.Net OPC Server?
 
I meant the browsing and then importing the symbols .. the OPC server that I encountered who does that is the siemens INAT OPC server
 
I meant the browsing and then importing the symbols .. the OPC server that I encountered who does that is the siemens INAT OPC server

OK, I just tested the trial version.

I did a little research on the Step7 dBase structures :)

I'm able to read the symbolic table, the list of blocks in the project and the database structures.
The absolut adresses in datablocks you have to calculate yourself. Then you have to solve UDTs, arrays and so on. I think it will take some time to figure this all out, but it's possible.
All you need you will find in the dBase files. Take a free dBase fileviewer like "DBF Viewer", or just use MS-Access (MS-Access 2000 was possible to load dBase files).

Interesting files for your project maybe
S7RESOFF.DBF, YLNKLIST.DBF, SUBBLK.DBF, BAUSTEIN.DBF, SYMLIST.DBF
 
I figured out most of it by now but I am getting confused on one thing: does anyone knows the link between the program IDs in the s7resoff file and the folder names inside the ombstx folder?? I had seen several cases where the ID number in the s7resoff table does not match the folder name in OMBSTX
 
I figured out most of it by now but I am getting confused on one thing: does anyone knows the link between the program IDs in the s7resoff file and the folder names inside the ombstx folder?? I had seen several cases where the ID number in the s7resoff table does not match the folder name in OMBSTX

Hihi,
I know this problem, and it took me several hours to find this thing out.
How much do you pay for this knowledge? 🍺
 
OK, here it is:
You take the ID of the program you want to load.
Then do a
SELECT RSRVD4_L FROM S7RESOFF WHERE ID = xxx

Then load file
/hrs/linkhrs.lnk

Read 512 bytes at offset position RSRVD4_L.

Then search for the hexadecimal values "016011", and take the next two bytes. This is the foldername.

I do this in Perl with a regex like this:
Code:
if($filedata =~ /\x01\x60\x11(.{2})/) {
  my @xx = unpack("C2", $1);
  $folder = sprintf "0000%02X%02X", $xx[0], $xx[1];
}
I don't know what this "016011" means, but it works.

Have you found out how the PLC hardware and programm folders come together?
 
Last edited:
there is a theory but I didn't test it enough yet: if you go through homsave7\shk3(number)AX then search inside the HRELATI1 tables for TOBJID (program ID taken from s7resoff) and TOBJTYP = 1331969 .. once you find that row you take the SOBJID & the SOBJTYP then you go through the homsave7\shk3(number)AX\HOBJECT1 table and looke for the SOBJID AND THE OBDJTYP you got and from there you get the CPU name of the program
 

Similar Topics

What does a siemens step 7 saved plc program project end with for example project1.xxx what are the last three letters?
Replies
2
Views
5,939
Good Morning, Hoping someone with some Siemens experience can give me a hand with this one. Customer has a S7-200 cpu, which has a 6GK7...
Replies
0
Views
214
I'm just trying to figure out the right method of adding a DO card to an existing rack. It's not the *next* open slot, but I have to move the AO...
Replies
5
Views
528
Hi Siemens Experts, I am hoping someone can shed some light on my issue. I have uploaded the code from a S7-300 (317-2PN/DP) using Step 7...
Replies
9
Views
593
Hello, We monitor the temperature of a pipe via a 4-20mA temperature transducer. This goes into DB135(Read Analog Inputs). The issue I have is the...
Replies
0
Views
615
Back
Top Bottom