×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Siemens S7 help

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

RE: Siemens S7 help

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.

RE: Siemens S7 help

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources