significance of multiple instance data blocks

SEEMA

Member
Join Date
Nov 2008
Location
PANCHKULA
Posts
20
multiple instance Data block in step7 programming reduce the number of instance data blocks....Does it saves memory also...if yes then how?????
 
Does it saves memory also
Yes
if yes then how
There's some overhead to each block, which defines the blocktype and number, the length and structure of the block etc. The overhead for a multiple instance data block is smaller than the sum of the overhead of all the instance data blocks it replaces. The memory needed for the data itself however is the same in both instances.
The complete answer is: yes, it saves memory, but only load memory, no work memory.

Kind regards,
 
Here's two example projects. One with 10 calls to a FB each with a instance DB, the other with 10 calls using multiple instances and one DB. I've shown the block memory properties for each.

For this example, the individual DB method uses less code but more data than the multiple instance method. The multiple instance method uses less overall, but, as there is more code, may take longer to execute.

Whether this is true for all cases (Size of the FB interface, number of calls etc.) I can't say.

singlefbs.JPG

multifbs.JPG
 
It seems I have to adjust my opinion. Your example tells us it also takes less work memory, which I didn't expect.

Thanks for the enlightenment.

Kind regards,
 
HI

Hope I am not been checky asking a question on someone else post.

I understand calling the same FB a number of times with a different DB for that call.To me its like having a FB for a pump or valve and
a DB for each valve or pump.My question is how would I use the same DB for different valves or pumps.

Thanks again

Donnchadh K.
 
Last edited:
Say your pump FB is FB1

Create FB2
In the stat area enter your pump instances

Name=Pump1 data type=FB1
Name=Pump2 data type=FB1
Name=Pump3 data type=FB1

then call them by name in FB2

CALL Pump1 (with params as required)
CALL Pump2 (ditto)
CALL Pump3 (ditto)

Save FB2

Finally, call FB2 from say OB1, when the instance DB is created, it will contain the data for all three pump instances.
 
Hi LD

Thanks for that.If I was using indirect address would I use the one
FB and indirect address the DB, would this be a the correct use in S7.

Thanks again L D[AR2,P#0.0] sorry if I am asking to many questions
but as I have said I just getting into S7 and I must say I am getting to both like it and understand it with the your great answers

Donnchadh K
 
Indirect address ? wrong terminology here (hopefully). Have you tried my suggestion in post#6
 
HI L D[AR2,P#0.0]

I am still at work but will try it when I get home.
I will get back to you then.

Talk soon
 
Here's an archived S7 library with a (made up) example of multiple instance pump control. Use simatic manager to retrieve this zip file.
 
Hi L D[AR2,P#0.0]

Thanks for that, will have a look at it later and let you know
how I get on.

Thanks again

Donnchadh K.
 
Hi L D[AR2,P#0.0]

Sorry for not getting back to you sooner, as I have been busy and
work.I am at home tonight and have had a look at the code you posted(Thank you).
I can see what you did with the one DB and that the symbols for the 3 pumps are here.(No problem)
Question 1
In FB2 Network 1 you turn on M100.1 when "bfaultStuckOn" is high.
This may be a dump question but way do you need to turn on m100.1
why can you not use #fb Pump1.bContactorStuckOnfault in the program
as m100.1 is a memory bit.

Question 2
Lets say I have a fault with pump one and I need to look at the code.Is there a way to look at FB1 with the pump 1 code or do I look at the call #fb Pump1 and just use the info here.

Question 3 and the last for now.

If i wanted to change the code in FB1 and have another out bit called "PumpRunningTest".Do I add a new symbol for each pump in DB200 and then change the code in FB1. If so will this update all the call for FB1.

Sorry if these are dumb questions but still trying to get my head around Siemens and not use AB terms or thinking.

Thanks again for your time

Donnchadh K
 
Answer 1.

I have not worked with HMI's that are "totally integrated" in Simatic manager, so I allocate a global DB for fault indication. Once the bit is allocated, that bit stays associated with the fault. In the example posted, I used M flags purely as something to enter for the fault bits, in a working project I would use, for example DB1.DBX0.0 etc. instead. As the data in the instance DB will shift if the interface is changed, I treat the instance DB as "private" and is only accessed by the associated FB's. Any data required is passed out via a parameter.

Answer 2

Where a block is called several times, you can specify the call up path to monitor a particular instance of the call. I posted an example for monitoring FC's (see below) so similar actions will apply for monitoring FB's
http://www.plctalk.net/qanda/showthread.php?t=32789&highlight=call+path

Answer 3

The instance DB gets created automatically when the editors detect you need to create the instance DB or the DB will need to be re-generated due to an interface change such is the case if you add a new parameter to an FB. You can right click on the Blocks container and perform Check Block consistency and then compile. This will update all the blocks that are dependant on the interface change and will re-generate the instance DB. Depending on the change you may need to open a block and update it manually (e.g. where new parameters are added to an FC). I do all of the updates manually out of habit.

Have fun :)
 
Last edited:
Hi L D[AR2,P#0.0]

Thanks for that, it makes that light and the end of the tunnell a little brighter .I undrerstand all you have said and it makes that old saying true again "Every day is a school day"
Thanks for your time and hopefully some day I can be of some help to you.

Thanks again to L D[AR2,P#0.0] and to all at PLCS.net

Donnchadh K.
 
Last edited:

Similar Topics

i am currently start8ing a project on plc.i am a B.E final year student and just know A,B,C of plc.
Replies
4
Views
5,527
Can I connect two A-B Panel View 7 to a A-B PLC. Same graphics etc. One on the local control panel and the other Panel View 7 in a remote control...
Replies
2
Views
37
is it possible to install multiple ibaPDAs on single VM or PC?
Replies
0
Views
37
Hi. I need to create several alarm servers in an application, but first I need to know if there is any impact on communication, or if more...
Replies
0
Views
73
Hello all, I know its not good practice to have duplicate destructive bits when writing plc code, but I'm wondering about writing to the same tag...
Replies
2
Views
141
Back
Top Bottom