Inst ToolsInst ToolsInst Tools
  • Courses
  • Videos
  • Q & A
    • Interview
      • Instrumentation
      • Electronics
      • Electrical
      • Practical Questions
    • MCQ
      • Instrumentation MCQ
      • Electrical MCQ
      • Electronics MCQ
      • Control Systems MCQ
      • Analog Electronics MCQ
      • Digital Electronics MCQ
      • Power Electronics MCQ
      • Microprocessor MCQ
      • Multiple Choice Questions
  • EE
    • Electronics
      • Electronics Q & A
      • Electronic Basics
      • Electronic Devices & Circuits
      • Electronics Animation
      • Digital Electronics
    • Electrical
      • Electrical Basics
      • Electrical Q & A
      • Power Electronics
      • Electrical Machines
      • Electrical Animation
      • Power Systems
      • Switchgear & Protection
      • Transmission & Distribution
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Search
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Reading: How Could FB and FC Make Me Professional PLC Programmer?
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • PLC Tutorials
  • Control Systems
Search
  • Courses
  • Videos
  • Q & A
    • Interview
    • MCQ
  • EE
    • Electronics
    • Electrical
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > How Could FB and FC Make Me Professional PLC Programmer?

How Could FB and FC Make Me Professional PLC Programmer?

It’s really important to know that any Siemens PLC programmer can use the FB and FC program methods to design any plant logic or function.

Last updated: September 28, 2022 2:25 pm
Hussien Ghareb
PLC Tutorials
No Comments
Share
9 Min Read
SHARE

Siemens, one of the best Automation vendors all over the world for many reasons and over long decades, Today we are going to deal with its software platform which is called TIA Portal (Totally Integrated Automation).

Contents
Structural Programming VS Linear ProgrammingThe Difference Between FB & FCExampleSummary

This software is the leading one that used in Europe as it’s reliable, very easy to use and one of the best features in this software that is combined between every Automation components that can be used by siemens (PLCs, Drives, HMI….), So you can commission and program all your project with just one software.

Structural Programming VS Linear Programming

In the Automation world there are two methods of programming Linear programming which, we can call it as basic programming, and structural programming or advanced one.

It’s really important to know that any PLC programmer can use the two methods to operate or program any plant or function, but for advanced programmers, it’s not the only problem for them “that the mission is accomplished or not”, but the big point that “How The Mission Accomplished” advanced programmers do not focus just on finishing the project but they are also considering about:

•   Does my code is really unique and organized?

•   Avoiding repeated and boring programming.

•   The sequence of the code.

•   Does my code help the PLC itself to operate with all of its power?

•   If we are back again, is it easy to modify?

So, organizing the code is very important for such DCS systems or other complex plants or systems, I just want to say please please Do NOT REFLECT THE COMPLEXITY OF THE PLANT INTO YOUR CODE.

Simply now I can say that is why we are using FB and FC into our code just for simplicity and organizing our codes, FB and FC can sorting your long project also can help you with repeated routines.

Think of that you have a plant that has 100 motor what is easier for you to write 100 coding programs to control these motors or just you can Write one code into a function and call it 100 times, think of it ….

The Difference Between FB & FC

How Could FB and FC Make Me Professional PLC Programmer

It sounds that the difference between function and function block seems to be slightly simple, but it’s never as simple as you imagine, the only notable difference is that Functions has not Static Memory to save its data.

So when you call it you will not need data block for each function that you have called, unlike function blocks it has a static memory inside, so for each time you call it you will need its instance data block to be attached with it.

Simply FC does not have memory block while FB requires instance Data Block for execution…. During every cycle FC loss its contents while the FB gets its memory to its associated block… So, if the idea is not clear for you till now this example would really help you.

Example

We are in a project that has multiple Level sensors that operate and control the action of our motors and conveyors.

Note that in a real field the level sensor reading might be stuck for just a few milliseconds and come live again after some brief interval.

Again, that is happened due to some field issues and there are some critical sensors that we could not allow that to happen with, so we need to make a delayed reaction to ensure that is the real level signal.

We can do that with timer but with a lot of level switches you will consume with every switch a separate timer from your plc, and that is really not professional way to deal with such a problem.

So here we can use a function that can make for us that delay and call it with every switch to allow a path for these switches through the same function to make your desired process (delay).

Example Function Program: Click Here

Example Call Program: Click Here

In the above example, the function logic is named “ONDLY-TMR” which is a timer program that provides some time delay wherever we use it.

In call program, we have different networks for level switches and motors. We call the function “ONDLY-TMR” in each network to provide the required time delay.

Note that for this situation you do not need any variable data to be stored, it’s just a delay that can be made easily without the need for static memory so here we can use FC.

Another usage of the FC is just for organizing the project and collecting similar instruction together to make your project tidy and easy to follow and troubleshoot your program

In the other hand we have a project that contain TANK FARM, this tank farm consists of eight tanks each tank has four mixers, three level switches, some of temperature transmitter and some valves.

The process might be complex but it’s really complex for just one tank and this process is just repeated, so my process for any tank must have some memory I really need some space for each tank in the memory to save some desired data such as (Tank Temp – Level – Valves state …).

So here I can not use FC because it does not support me with Separated memory for each tank, and if I made that with FC 100% there would be data conflict between tanks, here is the power of FB, I can make one FB and program it with the desired sequence then I will call it with every tank to allow a path for these tanks through the FB and also each tank will have its own data stored in its own data block (Instance Data Block)

I really hope that you got it ….

Summary

Now after you got the idea, we can summarize that with a little point

  • FC used to organize your program and to make it tidy
  • FC and FB used to save your effort for repeated coding
  • FC do not have the access to save your data in separate memory for each call, it losses its data every scan cycle
  • To call a function block you will need to tight with-it data block for each calling as it can store and separate data for each time you call it.

Finally, you will never get 100% of understanding till you try something by your self so please try to make it on your TIA and feel free to send me back to discuss that.

If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

  • Create a Function for a Valve Logic
  • Problem on PLC, HMI, VFD
  • FB Block in Siemens PLC Programming
  • Function Block for Motor Control Logic
  • Siemens Drum block for Sequencer Operation
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !

Continue Reading

Simulation of Studio 5000 and FactoryTalk View Studio
PLC Logic Example on Multiple Switches and Motors
What is a Tower Lamp? – Light Tower in Industrial Automation
Safety Considerations in PLC System Design
How to Read the PLC Datasheet? – Important Notes About PLC
Actuator Sensor Interface (ASi) Protocol in PLC
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
Leave a Comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
208kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

PLC Motor Operation based on Time Cycle Sequence – Program
What is Sequential Function Chart (SFC?)
Tia Portal – OB30 Cyclic Interrupt Organization Block
Top 100 PLC Projects List
How to use Master Control Reset (MCR) Instruction in PLC
What is Distributed IO? – Decentralized Peripherals in PLC
XG5000 Example of Simple Conveyor Control PLC Program
Types of Digital Outputs in PLC

Keep Learning

Components of SCADA

Components of SCADA

Schneider PLC Programming Example

Schneider PLC Programming Example for Beginners

PLC Program using Counters

PLC Counters Program

Introduction to SCL Programming in Siemens PLC

Types of Expressions in the SCL Language of the Tia Portal

ON DELAY TIMER AS OFF DELAY TIMER

How to Interchange ON Delay Timer and OFF Delay Timer in a PLC

Siemens CPU MP Port

Siemens S7-300 CPU Suffix Explanation

Types of Cables used in Industrial Automation

Types of Cables used in Industrial Automation

Faceplate in WinCC

Siemens HMI Training – Using UDTs with Faceplates

Learn More

PLC Batch System for 4 Tanks Mixing using CX-Programmer

PLC Batch System for 4 Tanks Mixing using CX-Programmer

Closed Tank Level Measurement using DP Transmitter

How can we use a DP Flow Transmitter for Level Measurement

Rotary Stem Valves

Rotary Stem Valves

Shutdown Motors in Timed Operation PLC Program

Shutdown Motors in Timed Operation PLC Program

DC motor speed control

DC Motor Speed Control

Structured Text PLC Program for Measuring Event Duration

Structured Text PLC Program for Measuring Event Duration

Function Block Diagram - Studio 5000 Logix Designer

Define the Order of Execution in Functional Block Diagram of Studio 5000

Digital Electronics Multiple Choice Questions

Registers Objective Questions

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?