Siemens - S7 400 PLC

Join Date
Jun 2017
Location
Coimbatore- Tamil Nadu
Posts
13
Hi good morning all...
First, I want to know what is the role of subroutine program in PLC programmming and type of subroutines how its differentiated.
1, Organisation Block
2, Data Block
3, FC - function
4, FB- Function block.

Im very new to PLC System . Can anybody suggest me how to learn/understand the concept easily or If you have any documents which can easily help to understand.
 
Start by looking at Chapter 4 of this manual:

https://support.industry.siemens.com/cs/document/45531107/simatic-programming-with-step-7-v5-5?dti=0&lc=en-WW

In short:

OB - Organization Block - CPU controls the execution of OBs.
Examples:
OB1 - Main Cycle Block (usually your main program is written here)
OB10 - Time-of-day Block - executes at a specified time of day and interval
OB35 - Cyclic Block based on a specified time interval (0-60000 ms)
etc...

DB - Data Block - stores data

FC - Function - logic subroutine without retentive parameter data

FB - Function Block - logic subroutine with retentive parameter data (stored in what's called an Instance Data Block (DB).
 
I don't know if you have any experience with programming in other languages, like C or C++, but will give it a go in explaining what those are for.

OB - This is what is called every time an event happens apart from OB1 which runs cyclically. If an error occurs an OB is called, if you program any interrupt from hardware, etc... another OB will be called. These are set up in your hardware configuration and there are a huge number of them available per CPU.

DB - This is where your data is stored. Instead of putting the data in memory by using M bits, you can create a DB and put your data there. There's two types of them, you'd normally create shared DB's. Instance DB's are usually created automagically with FBs.

FCs - These are functions that don't have any memory inside them. If you want to make a function that doesn't need to save the status of a variable, this would be the way to go. These are similar to C functions.

FB's - These are similar to functions (FC) but they have internal memory and retain values from cycle to cycle. FBs are really useful for programming fairly complex functionality. For example, a motor or valve object. These are more or less equivalent to C++ objects in that there is some encapsulation inside the FB.

What is the first project you'll be doing?
 
Quite brilliant, I wish I had thought of that!

This is one thing that I never understood with Step7 whenever you want to create a DB, you can create an instance DB. However, it won't ask you to which FB you want that DB linked to and when you call that DB, Step7 will tell you that it already exists and will be modified or something like this.

The other funny one I noticed the other day is that when you want to change the status of a bit online, you right click on it and you have "set to 0" and "set to 1" options... but it's a bit, so one of those options is useless for that situation. AB just has a toggle bit selection.
These are minor things though... overall, I think Siemens is still the best platform to do more out of the box.

@M Sabari Prakash,

If you have the program and you'll be in a maintenance role, I would start by understanding the hardware you are dealing with as this is what is most likely to fail. Check for any exotic encoders (such as the SSI interfaced ones) and how that data comes in and how you can check if the encoder is good and not jumping. Any hydraulic controllers and motor drives as well.
On the program side, start by finding where these sensors come into the program and work your way up.
Depending on how it's written, as soon as you understand how the inputs and outputs are programmed and where the interlocks are handled you should be ready to troubleshoot it.
Does the code have comments in it? If not, then this will be a bit of a problem.
 
When you create a DB by inserting it into the block folder you specify the FB number if it is an instance DB.

idb.jpg
 

Similar Topics

Good day, I need help locating/dowloading PLC Siemens Saphir SIO ACX32 driver for Proface GP-Pro/PBIII. I am in the process of upgrading a...
Replies
0
Views
1,389
Hello Experts, I would like to seek advise on how or what tag i should use or do to get the PLC diagnostic buffer to know what is the root cause...
Replies
14
Views
5,617
Dear Sir, I have a healthy profibus communication between SIEMENS PLC S7 400 and Allen Bradley drive PF700 using 20-comm-p profibus dp module...
Replies
3
Views
2,814
Hello Everyone, I use PLC S7-400 with Ethernet module CP 443-1 and i want to communicate with My galaxy via DAServer. I configure my PLC with...
Replies
2
Views
3,409
Hello everyone on PLC talk. Im new here, so i will be humble and was wondering if anyone have a complete description on the simatic s7-400 PLC...
Replies
6
Views
2,348
Back
Top Bottom