Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Siemens S7 help

Status
Not open for further replies.

fornhamspark

Electrical
Oct 23, 2004
44
GB
Iam new to siemens but have application knowledge of AB, Misubishi,Omrom etc.

Can someone explain in simple terms the application difference in the programming function blocks FC and FB.

Also the use of the DB datablocks.


Many Thanks

 
Replies continue below

Recommended for you

I am new to Siemens as well but recognize your issue. Here is what I have learned so far and others can add to as needed.

FCs are just simply blocks of code that perform a particular function. They do not have memory that remains after the FC has completed.

FBs are blocks that you can setup to use a FC over and over without having to reprogram it. You send parameters to the FB that calls a FC and it returns the result. You can specify DataBlocks that relate only to that FB and the data persists there.

DBs are blocks of data that you can setup to store globally or Unshared. These DBs can contatin any memory format including Arrays, DT variables and they can be mixed within the same DB. But they are just Blocks of Data.

I was really taken back by this architecture but it is slowly sinking in.

OBs by the way are Blocks that you can write logic in general but can set the OB itself to execute at different intervals or call them like you would a subroutine.

I know OB1 is the main Organizational Block and it is the one that cycles thru the PLC scan cycles. Other blocks are called from this one as a main.

 
FC-s have their local variables stored in temporal memory
(LB, LW, ...) and their values cannot be retained for
next program cycle.

FB-s have special DB-s to store their local variables.
These are called instance DB-s and are inserted via
Insert -> Data Block -> Instance Data Block

FC-s are usually universal functions like Scale, Add and so on.

FB-s are for different objects with same type (motors,
valves). You create one FB for all and instance for every device. Then you call the same FB and scecify different
DB for every device.

I hope everything is clear.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top