A newbie to S7 family

Shohadawy

Member
Join Date
Aug 2008
Location
Egypt
Posts
66
I've a previous experience in PLC programming as I worked with PLCs from Schnieder and altus companies.

Now I'm going to work with the great products of SIEMENS. I downloaded the manuals concerned with the Step7 lite software and began to read them. I found that the program is divided into blocks as:

1- Organization blocks
2-System function blocks
3-Function blocks
4-Functions
5-Instance data blocks
6-Data blocks

When shall I use each one of them ? Shall all of them be used in every program?
 
Hello shohadawy;
Along with the manuals you are studying, the following tutorials prepared by Siemens will help you develop and practice your expertise on Siemens S7-300 PLCs. They are designed for Step 7, but until you get to the networking tutorioals you should be able to adapt them to your Step 7 Lite:
https://www.automation.siemens.com/fea/html_76/down_module.htm?HTTPS=REDIR

Now, very briefly:
-OBs (Organization Blocks): these blocks are called by the operating system of the CPU, not by the programmer. OB1 is required in every program you develop, it is the Cyclic OB, or the equivalent of a C program's main(). This is where you organize and call all further blocks required for your application. The study of other OBs can come at a later time.

-FCs and FBs both allow you to program the routines you need for typical parts of the application. They are the equivalent of C procedures and subroutines. The difference between the two is small technically, FBs require an attached memory block (this is the Instance DataBlock), the FCs do not, but it will be important eventually. For starters you can say that both allow the development of your logic.
Say that you are controlling a few motors in your plant; an FC or FB will allow you to develop the logic for a "standard" motor, including inputs for the Start signal, the Stop signal, the Alarm outputs, the Run Feedback output... This block can be called as many times as you have real motors to control, without reprogramming the standard logic; all you need to do is use parameters to set the actual input and output addresses for each motor.
You will Call these functions (FCs and FBs) from OB1, or from another FC/FB called in OB1... You can nest the calling blocks up to 8 levels deep.

-DBs are memory blocks. They contain no logic, they are the equivalent of C STRUCTs: an organized collection of elementary data types, located in memory at a single location, accessible through the DB number: DB1.DBw2, for example.
When the S7 came out, memory was expensive for the electronics industry. Using DBs (and modular FC/FBs)and some form of memalloc() function allowed Siemens to optimize the use of available memory in the CPUs, making them very efficient and powerful, even comparing them to memory-bloated competition (! Ouch! prejudice alert!). A Controllogix PLC will come with between 2 and 8 MB of memory; a CPU 317-2DP comes with 512 kB of RAM; and some will dare compare the two... ;-)

-SFCs and SFBs are simply FCs and FBs preprogrammed by Siemens programmers, and offered to the users as instructiosn they can implement in their programs. The basic PID functions available in the S7-300 PLCs are SFC41 and SFC42; they are free,m and provide very good functionnality. If a user wishes for more detailed control, he can purchase "Standard PID", "Modular PID" or other products from Siemens that present more advanced functions. Or of course he can develop his own blocks for his own specifications.

Hope this helps you out a bit,
Daniel Chartier
 
Last edited:
you can do a search for my name and follow along as I trip through S7, some of my questions and discoveries may help you.

I hope they have some value.
 

Similar Topics

Hello all, I'm a new member here. I've joined as I want to learn about PLC programming. I've got a few questions to begin with. To get me...
Replies
37
Views
4,555
Howdy folks. Been doing PLC programming for like 15 years now in LD and ST, but I'm trying to learn SFC now and have a kind of dumb question... I...
Replies
4
Views
1,393
Hello. New to Unity and had a couple quick questions. Can a Modicon M340 output to a small multiline LCD screen and not a full HMI?
Replies
4
Views
962
Hi. I'm learning AOI programming in RSLogix 5000. I created an AOI with several input and output parameters but when I choose the AOI in the main...
Replies
17
Views
3,205
Good morning, I've had an inverter fail with firmware revision 5.002, the only spare is Rev 7.001, when updating the project with the new...
Replies
2
Views
1,260
Back
Top Bottom