Siemens Step 7 Data Block Inport/Export

Pete_S

Member
Join Date
Mar 2015
Location
Portland Maine
Posts
76
Hello,

I am trying to find an easy way to create data blocks in Step 7 with ~100K tags other than manually defining each tag in the LAD/STL/FDB view. Ideally it would be a process similar to RS Logix, where you can export tags to an .L5K file, edit the file with MS Excel drag indexing to generate a very large set of tags and then reimport the .L5K. I looked in the Step 7 programming manual and I didn't see a procedure for importing/exporting a data block. Thanks.
 
Hi Pete,

You can create your blocks as .awl text files, import them into the project, and then build them to create the DB's. You can do multiple at once.

I suggest you create a simple DB with each data type and some structures then generate a source .awl. Then you'll have a nice little template for formatting and can probably do some tricks with excel to create all your tags.

To do this, open anything in the LAD/STL/FBD editor and goto File>Generate Source. Then pick you project, pick your example DB. Generate it and then got back to SIMATIC Manager and open "sources" instead of blocks and you should be able to open it and see it as a plain text file.

Now you can follow that example and create your own and save it to your local hard disk. Then go back into SIMATIC Manager>Your Project>Sources and right click and select Insert New Object>External Source. Now you can open your file and hit ctrl+B to build it and vioala.

Also, I am making the assumption you're working with classic S7 (Simatic Manager V5.5 or earlier) and not TIA Portal.
 
SysIntegrator,

That is exactly what I was looking for, thank you very much. And your assumption is correct, that I am using Classic Step 7 (v5.5) for this particular OPC server load test (I forget that TIA portal still has Step 7). Again many thanks!
 
I am seeing some rather weird issues.
1) it appears as though I have a corrupt station on the controller. I have performed reset procedures for both the MMC and the CPU. I then create a new project with 1 station. The station has 1 OB and 1 DB. I download to the controller with no errors. But then when I go online and open the Blocks directory I see many DB's OB's and other objects not defined in my station. Or if I upload I have 2 stations in my project. HHHMMM???
2) I am not able to generate source for any data blocks. When I select File/Generate source from the LAD/STL/FBD view the Blocks directory in the project tree is grayed out. Maybe a function of issue 1?

If anyone has seen this and can advise how to resolve this issue I would greatly appreciate it.
 
go to accesible nodes, select your PLC and deleted all blocks. After that there should not be anymore blocks which you haven't loaded to PLC/MMC
 
Last edited:
2) I am not able to generate source for any data blocks. When I select File/Generate source from the LAD/STL/FBD view the Blocks directory in the project tree is grayed out. Maybe a function of issue 1?

The sources have to go in the Sources directory, not the blocks directory.
 
Hi Pete,

Point 2 was covered, but regarding point 1, totally normal, there's nothing wrong with your hardware or software. There's a lot of default blocks inside the controller even when it's completely been reset. In fact, I'm not even sure if some of them can be deleted.
 
But then when I go online and open the Blocks directory I see many DB's OB's and other objects not defined in my station.

Normally, when you download your project to an S7-300, it doesn't automatically delete what was already in the processor, it only adds/overwrites the new blocks. Also, normally a "Memory Reset" doesn't actually delete the MMC, btw, it resets everything back to the default values. When you factory reset the PLC, it does something similar. Deletes the work memory (RAM), then loads the work memory (MMC) back into it. Only when the MMC is already clear does a CPU reset do what you might expect it to.

If you go online with a blank project, you should see a bunch of sfb/sfc in the PLC. This is normal, these are standard system commands like timers, counters, and comm instructions. Any other blocks in the PLC (OB/DB/etc) shouldn't be there, unless you put them there.

There is a menu command that does a download, but clears the memory card first. It's the best way I've found to REALLY reset things to be the way I want. Unfortunately, I don't have S7 in front of me, and I can't recall the exact command name.

FYI, If you were in TIA Portal, you can copy/paste back and forth between excel and a DB, so no official import/export would really be necessary. I think you've already figured out how to do it for Simatic Manager.
 

Similar Topics

Just a quick question I can't find an answer on yet. I have created my own recipe structure using a Global DB and when I came in this morning...
Replies
2
Views
2,020
Hello All, Is there a way in Step 7 5.5 SIMATIC Manager to export a data block so that it can be imported into another project with all...
Replies
11
Views
3,732
Hello World Have a bit of an unusual problem. On a project currently being developed I have been issued with blocks that MUST be used, however...
Replies
2
Views
1,990
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
253
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
556
Back
Top Bottom