Inst ToolsInst ToolsInst Tools
  • Ask
  • 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: What are User Defined Function Blocks in PLC?
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • PLC Tutorials
  • Control Systems
Search
  • Ask
  • 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 > What are User Defined Function Blocks in PLC?

What are User Defined Function Blocks in PLC?

Function blocks are objects which are user defined in a PLC program to simplify the process of programming.

Last updated: October 17, 2023 1:19 pm
Viral Nagda
PLC Tutorials
No Comments
Share
5 Min Read
SHARE

In this post, we will understand the use of user defined function blocks in a PLC (programmable logic controller).

Contents
Function BlocksSystem Function BlocksUser-defined Function BlocksPLC Function Block Programming Example

Function blocks are objects which are defined in a PLC program to simplify the process of programming. Basically, it is a means of reducing the programming length and complexity written by the programmer.

Consider a simple example of a timer. A timer is a logic which sets it’s output after a certain time.

Now, if a PLC programmer was required to write timer logic by himself, it would be a long and cumbersome process for him.

And, if there were many such timers required to be used in the logic, then you could imagine the length of the program code.

It would become difficult for him to troubleshoot if any issue occurs; and even difficult if some other programmer tries to study it.

This is made easier by a function block. A function block comprises of a logic written inside in it; with inputs and outputs linked to it.

So, you can use multiple instances of this function block by simply linking its inputs and outputs with different variables.

Refer to the below image. It shows two instances or uses of the timer in the program.

The first one is named alarm_t1 and the second one is named alarm_t2.

Timer in PLC Function Block

The first-timer is turned on by a different condition and the second timer is turned on by a different condition.

This shows that you can use multiple timers in the program with different trigger conditions and different set intervals.

You just have to name the timers properly; such that anyone should not clash with others.

So, consider this same thing without a function block. If it was not used, then you would have to write the logic of the timer manually; which would indirectly increase the complexities.

Function Blocks

Function blocks make the job much easier, as you do not have to write the logic every time if it is the same.

You just have to link the inputs and outputs as discussed before.

They are categorized into two types.

  1. system and
  2. user-defined.

System Function Blocks

System blocks are that function blocks that are developed by the manufacturer and preloaded in the software.

A simple example can be a timer, which we discussed before.

User-defined Function Blocks

Now, let us look ahead to our main topic. Suppose if you are writing logic to start five motors after a set interval of time. All of them are required to turn off after a set interval of time.

Now, you can use a timer here. But what about the remaining logic? If you see, it is the same; with only the number of motors varying.

Now it is five motors; tomorrow a need can be raised for six. You cannot afford to write the whole logic manually every time, as it will waste time and also resources in the PLC software.

So, PLCs have a provision for user-defined function blocks. It gives programmer the facility to create a function block by himself, and assign the inputs and outputs accordingly.

This is extremely useful in conditions where the logic repeats several times and only the inputs and outputs change.

PLC Function Block Programming Example

Refer to the below image.

Hour meter PLC function block

Hourmeter is a function block defined by a user which has a logic written inside by him, for counting the running hours of a pump. ROFP_P_101A_HRS is the first block and ROFP_P_101B_HRS is the second function block.

The function block has its user-defined inputs and outputs; where you just have to link the conditions according to your requirements. This makes the work very easy and time-saving; as you will not have to write the logic of running hours individually for every pump.

One more advantage is that you can use any data type inside the function block. As you can use its multiple instances, it reduces the load of the programmer and saves time indirectly.

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

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

Read Next:

  • SCADA System with OPC UA
  • PLC Digital Output Types
  • Actuator Sensor Interface
  • PLC Communication Protocols
  • PLC to PLC Communication
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 !
What are High-Speed Counters and Fast Counters in PLC?
Ladder Logic for Control of Double-acting Pneumatic Cylinder
PLC Programming Best Practices and Tips
Control Room and Field Instruments Questions and Answers
How a PLC do the Scaling for a Sensor ?
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

Recent Comments

  • Kamli on Top Free PLC Software
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • MIHARITSOA Aina Sitraka on Top Non-PLC Certification Courses for Automation Professionals

Related Articles

Basics of PID Controllers

PID Controllers in Closed Loop Control Systems – PLC Basics

Cyclic Interrupts TIA Portal

Configuring and Usage of Cyclic Interrupts TIA Portal (OB 30+)

Connect PLC with SCADA System via OPC UA

How to Connect PLC with SCADA System via OPC UA?

DeMorgan's Theorems

DeMorgan’s Theorems using Ladder Diagram

Control 3 Motors with Toggle Switch

PLC Ladder Logic Design: Control 3 Motors with Toggle Switch

Two-Conveyor PLC Control System

Basic Conveyor System for Product Handling in Omron PLC

Conveyor Control with Main Motor and Backup Motor

Conveyor Operation with a Backup Motor using PLC Ladder Diagram

Safety Considerations in PLC System Design

Safety Considerations in PLC System Design

More Articles

What is insulation

What is insulation? How to Choose the Insulation Material?

Compressor IP Case Discharge Temperature Gradually Increases

Compressor Anti-Surge Control near-miss incident

Fiber Optic Measurement Techniques

Fiber Optic Measurement Multiple Choice Questions (MCQ)

Electrical Symbols

Electrical Symbols

Site Commissioning Steps for PLC Programmers

Site Commissioning Steps for PLC Programmers

solenoid-valves-types-principle-animation

Solenoid Valves Types, Principle & Animation

Pressure based Flowmeters

Pressure based Flow Meters

Introduction to SCL Programming in Siemens PLC

Types of Expressions in the SCL Language of the Tia Portal

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?