PLC Tutorials

FC Function in Siemens PLC

In this article, we will discuss the use of FC function in Siemens TIA PORTAL.

FC function is used in the PLC programming where a function or task use over and over.

We all know that designing PLC programs is sophisticated and tedious work especially when you have to write the same program again and again in different applications.

To overcome such an issue, we just have to write PLC programs once using the FC block and can easily call that program using the organization block (OB).

FC Function in Siemens PLC

Let’s learn how to create FC

1. Open the TIA PORTAL environment.

2. Create a new project.

3. Click on the write plc program.

4. Following window will, pop-up click on the below-shown icon.

6. The following window will open.

7. Click on add new block and select function as shown in the above window and click add.

Here, we will create a simple PLC program of Addition. Each time Function is called it increment value.

In the FC environment to create input, we have to select a variable from the section option.

Here, I have selected Local In. In local in whenever FC called in OB logic must be set every time as in our example, we want to do addition. so, the number will change each time FC called.

Global in use when a block has to retain its value until their value is changed by a function or by other logic.

The same rule is applicable to define the output.

Here, in the above window, I have created logic in function to add number 5 each time FC is called from OB.

Follow the step as shown in the window and the program which we have created in FC, now drag here into OB.

Example: FC Function for Valve Logic

You can see above the window in which I have to give a name to input and output and use a variable for the addition.

In the previous FC window, I took 5 to add. When this program executes and I make I0.1 make true it will add 5 + the number which wants to add. Here in our case, I use 45 so the last answer is 50.

So, every time OB executes it will call FC to make an addition.

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.

You've successfully subscribed !
Share

Recent Articles

  • Control Systems

What is Open Telemetry? – Principles and Benefits

Open Telemetry is a framework for collecting data in cloud-native applications including tracing, metrics, and…

5 days ago
  • Common

Control of Pneumatic Cylinder and Motor

This article is about controlling the Pneumatic cylinder and Pneumatic motor in the assembly line…

1 week ago
  • PLC Tutorials

Network Switch Requirement in SCADA and DCS Architecture

In this post, we will learn the basic requirements for a network switch to be…

5 days ago
  • PLC Tutorials

PLC Panel and MCC Panel Interface Signals

The PLC panel and MCC panel interface signals are start, stop, run feedback, trip, local…

1 week ago
  • PLC Tutorials

Shutter Door Control using Motor and Limit Switches

 In this article, we are going to discuss about shutter door control using induction motor…

1 week ago
  • Electrical Basics

Electrical Drives – Modes, Types, Speed Control Applications

Electrical Drives control the motion of electric motors. Motion control is required in industrial and…

1 week ago