doubt regarding simatic S7

sayahan2003

Member
Join Date
Jun 2006
Location
Calgary
Posts
185
Dear friends
I have 2 questions:
1- When we design a FB and when we create an IDB for
this FB, information in IDB will automatically
create.first of all, is it correct?
If yes, As you know we can have one FB with some
different date blocks.So, if information inside
these DB will create automatically regarding
variable decleration table of that FB, So what is
the differense between these DB's.Because the source
of all DB's is same.

2- As you know, when we create a new project, folder
"Source" will automatically created and we can
define some DB inside this folder.So, Would you
please tell me what are these DB's. these are shared
or instanse and why we create these DB's in the "
sourse" folder.

thank you
 
1. Yes, structure and initial values are created automatically when you create new IDB. You only need to select DB number and FB number.
Difference between IDBs is in actual values. You call, for example
call "PumpCtrl", "Pump1"
call "PumpCtrl", "Pump2"
Pump are similar. Principle of control for this pumps is the same. But actual parameters may differ. Working hours, for example.
2. Yes, you can to create DB and OB, FC, FB as AWL source. Working with source is similar to working with text editor. But you don't need to do this obligately. Furthermore, you don't need to open Source folder.:) You can do all within Blocks folder.
If you want to know what is the source, do in LAD/STL/FBD following:
Options -> Customize -> Sources -> Generate source automatically.
If you do this, whatever block which will be created in Blocks folder after saving will be represented in Source folder as .AWL source.
 
For 1.
Yes it is correct.

This is for when you program a sub-routine which will be called more than once for different objects of the same type and make-up.

Every time you program in a call to an FB the editor will automatically generate an instance DB.

That DB will be specific for that one call.

If you program another call to same FB for another piece of equipment, as Gambrinus suggested for another pump if it is an FB to control a pump, or maybe motor if it is a motor FB, it will generate another completely different Instance DB (it will not let you select the same or another already used DB address).

The make-up of the instance DB's generated for the same FB will be identical and if you open the instance DB in the editor, it will not let you add or remove declarations.

If you change the FB declarations (except TEMP declarations as these are not stored in the instance DB), the instance DB will require to be re-generated. The block call will turn RED in the program.

To correct this you would have re-generate all instance DB's for calls to that FB only. For each FB call comment out with // before the call and save. Then delete all instance DB's for that FB. Then remove all the //, it will ask you for a DB No, in each case re-enter the DB that you deleted for that call and the instance DB will be re-generated. If you added inputs or outputs it should leave these blank for you to fill in.

To download into the PLC, it would be best to STOP the PLC and download new blocks as a whole and restart.

DO NOT EVER CHANGE THE FB DECLARATIONS AND TRANSFER INTO A RUNNING PLC, you will more than likely see some red lights and screaming production managers. (there are controlled ways to do this but walk before you run).

2. AWL's in source. Keep away from, not necessary at your stage, get to know the main program editor before worrying about these. Mainly for code generation or SCL files anyway.
 
Last edited:
Dear Gambrinus
Thank you so much for your help.
Gambrinus said:
1. Yes, structure and initial values are created automatically when you create new IDB. You only need to select DB number and FB number.
Difference between IDBs is in actual values. You call, for example
call "PumpCtrl", "Pump1"
call "PumpCtrl", "Pump2"
Pump are similar. Principle of control for this pumps is the same. But actual parameters may differ. Working hours, for example.
2. Yes, you can to create DB and OB, FC, FB as AWL source. Working with source is similar to working with text editor. But you don't need to do this obligately. Furthermore, you don't need to open Source folder.:) You can do all within Blocks folder.
If you want to know what is the source, do in LAD/STL/FBD following:
Options -> Customize -> Sources -> Generate source automatically.
If you do this, whatever block which will be created in Blocks folder after saving will be represented in Source folder as .AWL source.
 
Last edited:
PeterW said:
If you change the FB declarations (except TEMP declarations as these are not stored in the instance DB), the instance DB will require to be re-generated. The block call will turn RED in the program.

To correct this you would have re-generate all instance DB's for calls to that FB only. For each FB call comment out with // before the call and save. Then delete all instance DB's for that FB. Then remove all the //, it will ask you for a DB No, in each case re-enter the DB that you deleted for that call and the instance DB will be re-generated. If you added inputs or outputs it should leave these blank for you to fill in.

You don't need to delete the calls. If only the instance DB is red (for example you have only added a STAT to an FB), do a 'File>Check and Update Accesses' and this will regenerate the instance DB's. If the block is red (e.g. you have added a new parameter) then right click on the red block and perform an 'Update Block Call', this will also tell you the instance DB is out of date and ask you if you want to regenerate it.
 

Similar Topics

Dear friends I have another doubt in simatic S7.As you know, when we define A function or function block, sometimes we define some Input or output...
Replies
8
Views
3,094
Dear friends I'm tring simatic s7.So, Would you please explain me what is diffrence between M(memory) and L(local).for example M0.0 and L0.0 and...
Replies
8
Views
3,860
hi.. Iam using GT Designer3 for designing a HMI in Mitsubishi GS Series.How Could I use a dropdown box in that.
Replies
0
Views
1,675
Hello guys, I would like your help confirming the 1761 NETENI function. As in the AB manual 1761 UM006E says: Peer-to-Peer Messaging This...
Replies
0
Views
1,691
Dear friend Can anybody tell me what is the differenc between PLC and DCS(distributed control system).and what is the real meaning of...
Replies
6
Views
4,915
Back
Top Bottom