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: FB Block in Siemens PLC Programming
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 > FB Block in Siemens PLC Programming

FB Block in Siemens PLC Programming

Last updated: March 4, 2021 12:35 pm
Editorial Staff
PLC Tutorials
No Comments
Share
5 Min Read
SHARE

This article is about the FB block which we use in Siemens PLC programming.

Function block (FB) is used to make the programming task easier. It is like subroutine which we have seen in Allen-Bradley PLC.

To stop writing the program over and over, it is a good practice to write the program in Function Block and call that program on-demand from OB.

The function block is configured to accept input from the main OB and write the output based on the execution of the FB.

FB is like FC with one difference in that is FC has overall memory space and doesn’t require any extra block to store that value whereas in FB it requires DB (Data Block) to store values. For each new FB, a new DB is required.

To understand how FB works, I will explain it using a simple example.

FB Block PLC Programming

Let’s first learn how to create FB, to do that so follow the below steps.

  1. Open the TIA PORTAL environment.
  2. Go to “PLC programming” and select “Function Block” and click on “add”.
Open TIA PORTAL environment
  1. The following window will pop-up, you can see here in the red square new block is added.
PLC programming and Function Block

Let, write PLC program for pet bottling process, where a bottle is getting rejected due to some issue like the cap is torn, weight is less or the cap is not properly fitted, etc.

The rejected bottle is automatically sent to the rejection conveyor. Now rejection ratio is too higher which fills till a proximity sensor activates in terms of sound alarm.

Let, assume we have 4 to 5 same rejection conveyor and I want to write the program. Now instead of writing the same logic over and over I will write the program in FB and call each time when OB executes.

  1. Here in the FB environment, you can find different options to write input and output as you can show in the figure.
How to Use FB Block in PLC Programming
  1. For our example, let consider 2 inputs and one output for alarm as shown in the below window.
Program Blocks in Siemens PLC
  1. In the below window you can see the program which I have written for rejection conveyor. Each time conveyor fills, the proximity sensor will turn ON which results in turning ON alarm.

A reset button is used to reset the alarm. Here, I have used alarm_1 as a latching in both input and output side because you can’t define output ALARM as input in FB block.

FB Block in Siemens PLC Programming
  1. To insert/add the above logic into the main OB we simply have to open the OB environment and have to drag FB block to OB.

As soon as you move FB to OB you will receive a pop-up as shown in the below window.

Here, you have to define the DB block as a memory space of FB. Click on “ok” to add DB.

siemens function block programming
  1. Here, by hitting ok the program will be added to OB as shown in the below window.
tutorial of siemens step-7 plc programming using simatic manager
  1. Define input and output. Whenever OB is executed it will call FB and Alarm will generate.

We can add other conveyor’s input and output here and each time any input gets activated, it will call FB and alarm will sound. Resetting the output will reset the alarm.

siemens plc db addressing
  1. Here, you can see how DB looks like. Db here will store the value of the FB.
Siemens STEP 7 PLC programming

Author: Suhel Patel

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:

  • Ladder Logic Examples
  • PLC, HMI, VFD, and Motor
  • Pulse Generation using Timer
  • Liquid Mixing PLC Logic
  • Alarm Acknowledge PLC
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

PLC Analog I/O and Network I/O
Design Counters in PLC Programming With a Move Instruction
Upgrading and Migration of PLC Systems
Allen Bradley Math Functions
PLC Programming Example on Bottle Line Control
Automatic Coffee Vending Machine – PLC Logic Programming
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

Ladder Logic MCQ Questions and Answers
What is Contextual HMI? – HMI Screens on a Mobile or Tablet
Everything You Need to Know About PLC Battery
What is Function Module in Siemens PLC?
Programmable Logic Controller Practice Tests
PLC Automatic Door Control System – Programming Example
How to Automatically Close Pop-up in FactoryTalk View Studio?
STL Programming – SET, RESET, ASSIGN

Keep Learning

Basic PLC Alarm Programming Example

Basic PLC Alarm Programming Example

Types of Scan Time in a PLC

#16 PLC Best Practices – Create Trend for Cycle Time on HMI

car parking example logic

Up Down Counter Instruction in PLC

Configuration of Siemens Scada and PLC

#12 PLC Best Practices – Validate Inputs based on Physical Plausibility

Example of Controlling the PLC Output using Push Buttons

Example of Controlling the PLC Output using Push Buttons

PLC Ladder Logic Door Open and Closing System

Which Language is Best for PLC Programming?

PLC FBD Example for Tank Liquid Heating Control by Steam Flow

PLC FBD Example for Tank Liquid Heating Control by Steam Flow

Conditional Jump instruction

Jump Instruction in Siemens Tia Portal

Learn More

PLC Program for Boolean Expression

PLC Program for Boolean Expression

Comparison of Control Loops - Open, Closed, Cascade, Feedforward, Ratio

Comparison of Control Loops – Open, Closed, Cascade, Feedforward, Ratio

OFF Delay Timer using PLC

OFF Delay Timer using PLC

What is an Automated Guided Vehicle

What is an Automated Guided Vehicle?

Split-Range, Auto-Selector Ratio, And Cascade Systems

Split-Range, Auto-Selector, Ratio & Cascade Systems

Digital Electronics Multiple Choice Questions

Design a flip-flop using other flip-flops Questions

Quick Exhaust Valve (QEV)

Quick Exhaust and Air Operated Valves in Instrumentation Circuit

Thermocouple Temperature Ranges

Thermocouple Temperature Range Questions and Answers

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?