New to Step 7, beginner question

Cryogen

Member
Join Date
Oct 2005
Location
NH
Posts
151
I need to program a siemens CPU 312C PLC. I am familiar with the S7-200 platform but this is my first project with the 300s and Step7.

I am not able to clearly understand the difference between FCs and FBs. I understand that FBs have DBs that store the memory values. But when we connect the FCs or FBs to the program, we need to fill in the variables in either case, don't we? This may be a silly question to all you experts but I just don't seem to get it..
Any help would be greatly appreciated..

Thanks!
 
FC's - parameter values must be entered when called. Only local temp data storage available (you can't use it to store data between calls)

FB's - parameter values are optional when called. As well as local temp data, static data is also available (the DB is used to store the data) so you can store data between calls to the FB (for edge detection etc)
 
If you only have a small amount of data that needs to be remembered, you can use an FC, storing the things that need remembering in Memory bits/bytes etc, or Data bits/bytes etc. These need to be declared as IN-OUT declarations.

An important thing to remember when using an FC, you cannot use something you've specified as an OUT before you have conditioned it and if you condition something you've specified as an IN and expect the address associated with it in the block call to e updated, it won't.

Example: if -Output is an OUT, the following code would not work in an FC.

A -Start
O -Output
A -Stop
= -Output

It will in an FB though and it would in an FC if -Output was an IN-OUT.
 

Similar Topics

Hi, I have a quick question for you all, When I try to load an FB into OB1 it faults the processor. I have one FB loaded and it works. If i try...
Replies
7
Views
2,507
I am having a step7 v5.4 program where the blocks are encrypted and locked. And the manufacturer is stopped the support. Is there any ways to...
Replies
2
Views
177
Good Morning, Hoping someone with some Siemens experience can give me a hand with this one. Customer has a S7-200 cpu, which has a 6GK7...
Replies
0
Views
248
HI! HOW COULD I OBTAIN THE NAMES OF THE STEPS OF A ROUTINE IN SFC LANGUAGE IN STUDIO5000? Or is there a system variable that gives me those...
Replies
0
Views
339
Back
Top Bottom