Siemens S7 help
Siemens S7 help
(OP)
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
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





RE: Siemens S7 help
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.
RE: Siemens S7 help
(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.