Block organisation in Step7

RMA

Member
Join Date
Sep 2004
Location
North of Hamburg, Germany
Posts
2,052
The project I'm working on at the moment is my first large Step7 project (at least where I've been responsible for the organisation of the project structure).

As a result, since I'm now up to over 200 blocks and still adding blocks, although I thought I had spread stuff out fairly well, things are starting to get a bit full. This means that I can't allways put related blocks adjacent to one another. It's a particular problem with the DBs, because I like to give the Instance DBs the same number as the FB, indeed the FM352-5 insists on it - the software will allow you to specify any number you want, but at run time, in "Debug" mode, if it finds a DB with the same number as the FB, it uses it regardless - with obvious consequences! In "Normal" mode, there is no problem, because the program which is downloaded into the FMs FPGA has a completely different structure and don't use DBs as such.

Adding to the problem is the fact that the Siemens library blocks use the same numbers several times over. I don't like changing the numbers, because it's then not necessarily obvious at a glance which are my program blocks and which are Library blocks.

I'm toying with the idea of banging all my blocks up to numbers of 500 or a 1000, leaving the bottom area for Library blocks with the scheme (say) Comms Blocks - 0xx, IEC Function blocks - 1xx, Miscellaneous blocks - 2xx etc. Then start my own FBs at 5xx, FCs at 6xx etc. The other question is whether its better to split FBs and FCs well away from one another, or rather keep functionally related blocks together whether FB or FC (although I think that might lead to problems with the Instance DBs, again)?

If I'm going to change something like this in a radical way, I need to do it in the next few weeks, before the first Module goes out the door. The structure needs to be well thought out and flexible, because so far I've mainly had to concentrate on basic system functionality and HMI. What will come up as I start adding error monitoring, messaging and logging, I hate to think!

Have any of you guys who have done big programs developed some sort of logical structure to solve this problem? Any suggestions and thoughts (especially about any points/consequences I haven't thought about) will be extremely welcome!
 
Last edited:
Look into the multiple instance data blocks- this will save on your amount of DB's. Also be careful with these numbers FC3xx..FB3xx because if your using an S7300 it may not support this.
 
I'm using a 317-2 DP with 512 kB, which can have up to 2047 FBs, FCs etc., so that's not a problem. The large number of DBs comes from multiplex DBs for indirectly addressing the I/O in 21 identical modules.

One problem is that the person who is (probably) going to have to maintain this once I am gone has very little S7 experience and I have found that if you aren't working regularly with them, multiple instances can be a bit hard to follow. Since I've got bags of memory, I prefer to keep it as simple and easy to follow as possible. Efficiency isn't a problem here, it's a slow, one-shot process. Ease of maintenance, however, is a very big priority.
 
I think it is a lost battle to somehow rely on the function and db numbers for organization. When I do projects, I just grab the next available number and go with it. But, I always use a name that makes sense, and give it a prefix that identifies the block type. For instance:

"DB Drive Control"
"DB HMI Interface"
"DB Machine Configuration"
"FC Drive Control"
"FC Machine Configuration"
"FC HMI Interface"
"FB Drive Control"

etc, etc.

That way, they can sort the functions alphabetically, and easily find related blocks even if the numbers aren't in any logical pattern. Looking above, if I was looking for everything that has to do with drive logic, I can easily find the drive DB and the drive FC and FB.
 
Thanks, as usual you come up with the answer!

In fact I'm already naming most things that way, virtually all my DBs are named that way and by chance also differentiated between normal DBs, Instance DBs and Multiplex DBs. What I hadn't thought of, was sorting by Symbolic Name. So I only need to modify the names of the FBs and FCs, which aren't that many, and we've got the problem solved.

It also avoids another potential problem, in OB100 I'm initialising a lot of stuff in DW chunks so the Symbolic Names don't show up, so not everything would get modified automatically and I would be almost certain to make some mistakes correcting them by hand. On the other hand, I'm seriously considering going through and doing everything one by one for the sake of clarity again, the only thing stopping me is that it adds up to about another 500 tags!
 

Similar Topics

In the past, we have used AB 1492 feed thru screw terminals a lot. Lead time on these with our distributor is terrible. Is there an almost...
Replies
1
Views
109
Hello, This product that I have the 1790D-T8BV8B is discontinued, does anyone have the EDS file for it? I wonder if TechConnect will have this...
Replies
8
Views
183
Hi, I have attached herewith one image which our programmer has been used in S7 1500 PLC. Now we need to use the same instructions in S7 1200 PLC...
Replies
4
Views
114
Please see attached file. I need this program in Function Block form but I am totally lost on this. Any help would be appreciated. Thanks!
Replies
8
Views
291
I am having a step7 v5.4 program where the blocks are encrypted and locked. And the manufacturer is stopped the support. Is there any ways to...
Replies
2
Views
170
Back
Top Bottom