{"id":58058,"date":"2023-03-21T09:00:00","date_gmt":"2023-03-21T03:30:00","guid":{"rendered":"https:\/\/ye1o34zhk8.onrocket.site\/?p=58058"},"modified":"2023-03-15T13:33:47","modified_gmt":"2023-03-15T08:03:47","slug":"functions-in-plc-programming","status":"publish","type":"post","link":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/","title":{"rendered":"What are Functions in PLC Programming? (FCs)"},"content":{"rendered":"\n<p>Programming a certain <strong>industrial process using a PLC<\/strong> can be very simple and easy to achieve provided that you are able to use the many tools available within the PLC, these tools are there to help you reach your programming goals easily and fast and also help you write an easy to read, follow and debug code.<\/p>\n\n\n\n<p>One of these many tools in a PLC is the <strong>Function blocks or FCs<\/strong>. In this article we will get to know the <strong>basics of function blocks<\/strong>, what are they, when to use them, and how to use them.<\/p>\n\n\n\n<p><strong>Contents:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Simple process.<\/li><li>More complicated process.<\/li><li>What is a Function (FC)?<\/li><li>How to create and use an FC?<\/li><li>Program simulation.<\/li><li>Conclusions.<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Simple Process<\/h2>\n\n\n\n<p>Let\u2019s consider a simple industrial process where you have a conveyor belt <strong>M1<\/strong> that runs to transfer a product (<strong>P1<\/strong>) to the end of the line. The conveyor will run when a start <strong>S1<\/strong> signal is available after a presence sensor <strong>B1<\/strong> detects the product on the Belt.<\/p>\n\n\n\n<p>The conveyor will start running and continue to run until the product is transferred to the end of the line and a detection sensor <strong>B2<\/strong> detects the product, then the belt will stop. See picture 1.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/PLC-industrial-Conveyor-process.png\" alt=\"PLC industrial Conveyor process\" class=\"wp-image-58060\"\/><figcaption>Picture 1 &#8211; Simple Conveyor System<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Coding this process in your PLC will be fairly simple and easy, considering you have few inputs and outputs in this logic.<\/p>\n\n\n\n<p>When coding this logic in <a href=\"https:\/\/instrumentationtools.com\/siemens-tia-portal-plc-training-course\/\" target=\"_blank\" rel=\"noreferrer noopener\">Siemens TIA Portal<\/a>, it will be as follows:<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>Create your project.<\/li><li>Configure your PLC (in our example we used <strong>CPU 1512C-1 PN<\/strong>).<\/li><li>Define your input\/output tags: see picture 2.<\/li><\/ol>\n\n\n\n<ul class=\"wp-block-list\" type=\"1\"><li>Start push button S1&nbsp; <strong>%I10.0<\/strong><\/li><li>Detection sensor B1&nbsp;&nbsp; <strong>%I10.1<\/strong><\/li><li>Detection sensor B2&nbsp;&nbsp; <strong>%I10.2<\/strong><\/li><li>Conveyor Motor M1&nbsp;&nbsp; <strong>%Q4.0<\/strong><\/li><\/ul>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"677\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/defining-your-tags-in-PLC.png\" alt=\"defining your tags in PLC\" class=\"wp-image-58062\"\/><figcaption>Picture 2 &#8211; defining your tags<\/figcaption><\/figure>\n<\/div>\n\n\n<p>4. Open your main OB1 and write your code. See picture 3.<\/p>\n\n\n\n<p>5. Compile and run your logic.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"678\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/main-OB1-and-write-your-plc-code.png\" alt=\"Functions in PLC Programming\" class=\"wp-image-58063\"\/><figcaption>Picture 3 &#8211; the logic of the conveyor belt<\/figcaption><\/figure>\n<\/div>\n\n\n<p>As you can see from picture 3, the logic of this process is very simple and it works as follows:<\/p>\n\n\n\n<p>When a product is at the start of the belt and the start Push button is pressed the conveyor will run and it will keep running until the product is detected at the end of the line.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">More Complicated Process<\/h2>\n\n\n\n<p><strong>Now<\/strong>, imagine your production line has 50 conveyor belts all of them need to be controlled in the same manner as <a href=\"https:\/\/instrumentationtools.com\/how-to-detect-speed-of-conveyor-in-plc\/\" target=\"_blank\" rel=\"noreferrer noopener\">conveyor<\/a> <strong>M1<\/strong>. One approach to achieve this will be by repeating steps 3 through 5 fifty times. This is not wrong, but now you have to write the same logic 50 times, and even if you just copied network 1 in picture 3 and paste it fifty times, you still have to redefine and reassign the new tags to the new networks.<\/p>\n\n\n\n<p><strong>Another hustle<\/strong> you might face is when you need to add a new parameter for your control, for example, you need to add a <a href=\"https:\/\/instrumentationtools.com\/push-button-motor-plc-logic\/\" target=\"_blank\" rel=\"noreferrer noopener\">stop push button<\/a> in your logic to stop the conveyor belt at any time the button is pressed. That means you will now define the new input signal and you will have to write it fifty times for your fifty networks, See picture 4.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/More-Complicated-Process-in-Siemens-Tia.png\" alt=\"More Complicated Process in Siemens Tia\" class=\"wp-image-58064\" width=\"800\" height=\"397\"\/><figcaption>Picture 4 &#8211; Re-editing your code<\/figcaption><\/figure>\n<\/div>\n\n\n<p>You see, you will have to make this change in all fifty networks of your logic. And if you forget one, your code will not work as desired and most likely it will not be something that your compiler can detect. So programming your logic this way has a lot of disadvantages.<\/p>\n\n\n\n<p>The Best approach is to use <strong>Function Blocks or FCs<\/strong>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"h-what-is-a-function-block-fc\">What is a Function Block (FC)?<\/h2>\n\n\n\n<p>A function block or<strong> FC<\/strong> is simply a block that contains a specific logic made by a programmer, this logic or <strong>FC<\/strong> will be executed whenever it is called.<\/p>\n\n\n\n<p>Functions can be used, for example, for the following purposes:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>To return function values to the calling block, e.g. for mathematical functions.<\/li><li>To execute technological functions, e.g. individual controls using bit logic operations.<\/li><\/ul>\n\n\n\n<p>You have been using functions all along, maybe you haven\u2019t noticed, but some of the basic instructions you usually use in your codes are actually function blocks, and each time you use this instruction you just call the FC and assign your parameters to it.<\/p>\n\n\n\n<p>Examples of these functions are mathematical instructions like <strong>ADD <\/strong>&amp; <strong>MOVE<\/strong> instruction. See picture 5.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"680\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/What-is-a-Function-Block-FC.png\" alt=\"What is a Function Block (FC)\" class=\"wp-image-58066\"\/><figcaption>Picture 5 &#8211; ADD&amp;MOVE are examples of FCs<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">How to Create and Use an FC?<\/h2>\n\n\n\n<p>Now, back to our fifty conveyor belt process, how can we apply the FC concept to our logic?<\/p>\n\n\n\n<p>The simple concept is that you will create a function block that has the logic of operation of the conveyor belt created inside, and each time to need to run a certain conveyor belt you will just call the <strong>FC <\/strong>and assign the parameter of this conveyor.<\/p>\n\n\n\n<p>For example, if I want to run the conveyor belt 20 in my process, I will call this function and give it the parameters of the conveyor belt 20. Same if I want to run belt 46 or any other conveyor.<\/p>\n\n\n\n<p>That means I will create the logic only one time. And reuse it whenever I need to. It also means, if at any point I decided to add something to my logic, I will only make that edit in the main FC block, that change will automatically be included each time you call the function.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Functions in PLC Programming<\/h2>\n\n\n\n<p>To create an FC Block, we do the following Steps.<\/p>\n\n\n\n<p>In Siemens TIA Portal, Create a function block, by pressing the <strong>add new block<\/strong> icon, see picture 6.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"677\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/How-to-Create-and-Use-an-FC-Block.png\" alt=\"How to Create and Use an FC Block\" class=\"wp-image-58067\"\/><figcaption>Picture 6&nbsp;&#8211; create new function block.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Create the conveyor belt logic as you did before, but don\u2019t assign specific IOs for that logic, instead define IOs inside the <a href=\"https:\/\/instrumentationtools.com\/user-defined-function-blocks-in-plc\/\" target=\"_blank\" rel=\"noreferrer noopener\">function block<\/a> interface, so it can be reused again. See picture 7.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"679\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/create-your-FC-logic.png\" alt=\"create your FC logic\" class=\"wp-image-58068\"\/><figcaption>Picture 7 &#8211; Create your FC logic<\/figcaption><\/figure>\n<\/div>\n\n\n<p>You now finished coding your function; you can call this function anytime you want to execute that logic. See picture 8.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"678\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/call-your-FC-Block.png\" alt=\"call your FC Block\" class=\"wp-image-58070\"\/><figcaption>Picture 8 &#8211; calling your FCs<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Notice, that each time you <strong>call the function<\/strong>, it will ask you to assign the inputs\/outputs parameters of the function. That way you can use the same logic for different conveyors.<\/p>\n\n\n\n<p>If for example, I need to operate conveyors 1 and 15 I will call the function twice and give each call the parameters of a certain conveyor. See picture 9.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"679\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/assigns-different-PLC-parameters-to-different-function-calls.png\" alt=\"assigns different PLC parameters to different function calls\" class=\"wp-image-58071\"\/><figcaption>Picture 9 &#8211; assigns different parameters to different function calls.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Now, imagine you need to edit your logic and add some extra functionality, for example, you want to add an output that will be ON whenever the conveyor is running, and you will use this output for an <a href=\"https:\/\/instrumentationtools.com\/plc-program-for-daily-production-record\/\" target=\"_blank\" rel=\"noreferrer noopener\">indication lamp<\/a> to notify the operators that this conveyor is now running.<\/p>\n\n\n\n<p>Using the concept of FCs, you will just have to edit your logic inside the function and it will be implied whenever you use your function. See picture 10.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"677\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/editing-function-block.png\" alt=\"editing function block\" class=\"wp-image-58072\"\/><figcaption>Picture 10 &#8211; Editing your function block<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Now, each time you call the function it will ask for the indication lamp output tag for each call. See picture 11.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"682\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/Function-Block-Example-Code-in-PLC.png\" alt=\"Function Block Example Code in PLC\" class=\"wp-image-58073\"\/><figcaption>Picture 11 &#8211; Editing the FC will be implied in each function call<\/figcaption><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\">Program Simulation<\/h2>\n\n\n\n<p>We will now, simulate our program to see how a function works. Follow the next steps:<\/p>\n\n\n\n<p>Compile your <a href=\"https:\/\/instrumentationtools.com\/plc-program-conveyor-motor\/\" target=\"_blank\" rel=\"noreferrer noopener\">PLC code<\/a> and start a new simulation.<\/p>\n\n\n\n<p>At first, you see the Function is called twice, for conveyors 1 and 15 see picture 12.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"679\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/Function-Block-Program-Simulation.png\" alt=\"Function Block Program Simulation\" class=\"wp-image-58074\"\/><figcaption>Picture 12 &#8211; Simulation of program.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Now, try to run conveyor 1 by activating S1 and B1, see picture 13.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"679\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/Learn-How-to-Use-FC-for-Programing-Siemens-PLC.png\" alt=\"Learn How to Use FC for Programing Siemens PLC\" class=\"wp-image-58075\"\/><figcaption>Picture 13 &#8211; only conveyor 1 is running<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Notice, how only belt 1 is running, even though we have two calls for the same function, but conveyor 15 is not running as its conditions are not met yet.<\/p>\n\n\n\n<p>Now, try to run conveyor 15, and notice that its operation is completely separate from the conveyor 1 process, even though it is the same function. See picture 14.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" loading=\"lazy\" decoding=\"async\" width=\"1365\" height=\"680\" src=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/What-are-PLC-function-blocks.png\" alt=\"What are PLC function blocks\" class=\"wp-image-58076\"\/><figcaption>Picture 14 &#8211; Different function calls are independent of each other.<\/figcaption><\/figure>\n<\/div>\n\n\n<p>Did you notice, how after a while conveyor 1 stopped as the B2 signal is now true? While conveyor 15 still running. That is how a function block in a plc can be created and used.<\/p>\n\n\n\n<p><strong>Downloads:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/PDF\/PLC\/Project\/Function%20Block%20Example.zip\" target=\"_blank\" rel=\"noreferrer noopener\">Siemens Tia Portal Sample Code<\/a><\/li><li><a href=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/PDF\/PLC\/Siemens\/Siemens%20FC%20Block%20Logic.pdf\" target=\"_blank\" rel=\"noreferrer noopener\">Function Block Code in PDF<\/a><\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Using function blocks or FCs in your logic will optimize your code and make it clean and easy to understand. It will also give you the advantage of reusing your code as many times as you want in one program which will reduce a lot of coding and editing time and also will reduce errors in your program.<\/p>\n\n\n\n<p>If you liked this article, then please subscribe to our <a href=\"http:\/\/youtube.com\/instrumentationtools?sub_confirmation=1\" target=\"_blank\" rel=\"noreferrer noopener\">YouTube Channel<\/a> for PLC and SCADA video tutorials. <\/p>\n\n\n\n<p>You can also follow us on <a href=\"https:\/\/www.facebook.com\/instrumentationtoolss\" target=\"_blank\" rel=\"noreferrer noopener\">Facebook<\/a> and <a href=\"https:\/\/twitter.com\/InstTools\" target=\"_blank\" rel=\"noreferrer noopener\">Twitter<\/a> to receive daily updates.<\/p>\n\n\n\n<p id=\"h-read-next\"><strong>Read Next:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/instrumentationtools.com\/jump-instruction-in-plc-ladder-logic\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to use JUMP Instruction<\/a><\/li><li><a href=\"https:\/\/instrumentationtools.com\/plc-running-hours\/\" target=\"_blank\" rel=\"noreferrer noopener\">Program to Count Running Hours<\/a><\/li><li><a href=\"https:\/\/instrumentationtools.com\/plc-program-water-level-control\/\" target=\"_blank\" rel=\"noreferrer noopener\">Water Level Control Logic<\/a><\/li><li><a href=\"https:\/\/instrumentationtools.com\/tank-level-detection-switches\/\" target=\"_blank\" rel=\"noreferrer noopener\">Tank Level Detection Switches<\/a><\/li><li><a href=\"https:\/\/instrumentationtools.com\/security-of-industrial-automation-systems\/\" target=\"_blank\" rel=\"noreferrer noopener\">Industrial Automation Systems<\/a><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>In this article we will get to know the basics of functions in PLC programming, what are they, when to use them, and how to use FC.<\/p>\n","protected":false},"author":101030,"featured_media":58074,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mo_disable_npp":"","footnotes":""},"categories":[6],"tags":[96699,41887],"class_list":{"0":"post-58058","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-plc","8":"tag-plc-function-block","9":"tag-plc-function-block-programming-examples"},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>What are Functions in PLC Programming? (FCs)<\/title>\n<meta name=\"description\" content=\"In this article we will get to know the basics of functions in PLC programming, what are they, when to use them, and how to use FC.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What are Functions in PLC Programming? (FCs)\" \/>\n<meta property=\"og:description\" content=\"In this article we will get to know the basics of functions in PLC programming, what are they, when to use them, and how to use FC.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/\" \/>\n<meta property=\"og:site_name\" content=\"Inst Tools\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/instrumentationtoolss\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-21T03:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/Function-Block-Program-Simulation.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1365\" \/>\n\t<meta property=\"og:image:height\" content=\"679\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Mahmoud Salama\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"What are Functions in PLC Programming? (FCs)\" \/>\n<meta name=\"twitter:description\" content=\"In this article we will get to know the basics of functions in PLC programming, what are they, when to use them, and how to use FC.\" \/>\n<meta name=\"twitter:creator\" content=\"@insttools\" \/>\n<meta name=\"twitter:site\" content=\"@insttools\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mahmoud Salama\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/\"},\"author\":{\"name\":\"Mahmoud Salama\",\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/#\\\/schema\\\/person\\\/21192a950c6d97eae4517ff0153e7eb6\"},\"headline\":\"What are Functions in PLC Programming? (FCs)\",\"datePublished\":\"2023-03-21T03:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/\"},\"wordCount\":1471,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/instrumentationtools.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Function-Block-Program-Simulation.png\",\"keywords\":[\"PLC Function Block\",\"plc function block programming examples\"],\"articleSection\":[\"PLC Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/\",\"url\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/\",\"name\":\"What are Functions in PLC Programming? (FCs)\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/instrumentationtools.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Function-Block-Program-Simulation.png\",\"datePublished\":\"2023-03-21T03:30:00+00:00\",\"description\":\"In this article we will get to know the basics of functions in PLC programming, what are they, when to use them, and how to use FC.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/#primaryimage\",\"url\":\"https:\\\/\\\/instrumentationtools.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Function-Block-Program-Simulation.png\",\"contentUrl\":\"https:\\\/\\\/instrumentationtools.com\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Function-Block-Program-Simulation.png\",\"width\":1365,\"height\":679,\"caption\":\"Function Block Program Simulation\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/functions-in-plc-programming\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/instrumentationtools.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What are Functions in PLC Programming? (FCs)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/#website\",\"url\":\"https:\\\/\\\/instrumentationtools.com\\\/\",\"name\":\"Instrumentation Tools\",\"description\":\"Instrumentation, Electrical, PLC, Tutorials\",\"publisher\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/#organization\"},\"alternateName\":\"Inst Tools\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/instrumentationtools.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/#organization\",\"name\":\"Instrumentation Tools\",\"alternateName\":\"Inst Tools\",\"url\":\"https:\\\/\\\/instrumentationtools.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/instrumentationtools.com\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Instrumentation-Tools-Logo.png\",\"contentUrl\":\"https:\\\/\\\/instrumentationtools.com\\\/wp-content\\\/uploads\\\/2018\\\/10\\\/Instrumentation-Tools-Logo.png\",\"width\":1024,\"height\":1024,\"caption\":\"Instrumentation Tools\"},\"image\":{\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/instrumentationtoolss\\\/\",\"https:\\\/\\\/x.com\\\/insttools\",\"https:\\\/\\\/mastodon.social\\\/@InstrumentationTools\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/instrumentationtools\\\/\",\"https:\\\/\\\/whatsapp.com\\\/channel\\\/0029VaAbUecLNSa4rDPOV31o\",\"https:\\\/\\\/t.me\\\/+u3qORX5FKec1NjA1\",\"https:\\\/\\\/www.instagram.com\\\/instrumentationtools\\\/\",\"https:\\\/\\\/youtube.com\\\/instrumentationtools\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/instrumentationtools.com\\\/#\\\/schema\\\/person\\\/21192a950c6d97eae4517ff0153e7eb6\",\"name\":\"Mahmoud Salama\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8c5c90be32d507b5003130bbdf6ef7d54d4f8943dd3712ffaf286c5f44cc15f7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8c5c90be32d507b5003130bbdf6ef7d54d4f8943dd3712ffaf286c5f44cc15f7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8c5c90be32d507b5003130bbdf6ef7d54d4f8943dd3712ffaf286c5f44cc15f7?s=96&d=mm&r=g\",\"caption\":\"Mahmoud Salama\"},\"description\":\"Experienced Electrical Maintenance Engineer with over 7 years of experience. Skilled in PLC, SCADA, and HMI programming in many platforms(TIA-Portal on top).\",\"url\":\"https:\\\/\\\/instrumentationtools.com\\\/author\\\/mahmoud-salama\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"What are Functions in PLC Programming? (FCs)","description":"In this article we will get to know the basics of functions in PLC programming, what are they, when to use them, and how to use FC.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/","og_locale":"en_US","og_type":"article","og_title":"What are Functions in PLC Programming? (FCs)","og_description":"In this article we will get to know the basics of functions in PLC programming, what are they, when to use them, and how to use FC.","og_url":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/","og_site_name":"Inst Tools","article_publisher":"https:\/\/www.facebook.com\/instrumentationtoolss\/","article_published_time":"2023-03-21T03:30:00+00:00","og_image":[{"width":1365,"height":679,"url":"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/Function-Block-Program-Simulation.png","type":"image\/png"}],"author":"Mahmoud Salama","twitter_card":"summary_large_image","twitter_title":"What are Functions in PLC Programming? (FCs)","twitter_description":"In this article we will get to know the basics of functions in PLC programming, what are they, when to use them, and how to use FC.","twitter_creator":"@insttools","twitter_site":"@insttools","twitter_misc":{"Written by":"Mahmoud Salama","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/#article","isPartOf":{"@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/"},"author":{"name":"Mahmoud Salama","@id":"https:\/\/instrumentationtools.com\/#\/schema\/person\/21192a950c6d97eae4517ff0153e7eb6"},"headline":"What are Functions in PLC Programming? (FCs)","datePublished":"2023-03-21T03:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/"},"wordCount":1471,"commentCount":1,"publisher":{"@id":"https:\/\/instrumentationtools.com\/#organization"},"image":{"@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/#primaryimage"},"thumbnailUrl":"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/Function-Block-Program-Simulation.png","keywords":["PLC Function Block","plc function block programming examples"],"articleSection":["PLC Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/instrumentationtools.com\/functions-in-plc-programming\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/","url":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/","name":"What are Functions in PLC Programming? (FCs)","isPartOf":{"@id":"https:\/\/instrumentationtools.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/#primaryimage"},"image":{"@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/#primaryimage"},"thumbnailUrl":"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/Function-Block-Program-Simulation.png","datePublished":"2023-03-21T03:30:00+00:00","description":"In this article we will get to know the basics of functions in PLC programming, what are they, when to use them, and how to use FC.","breadcrumb":{"@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/instrumentationtools.com\/functions-in-plc-programming\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/#primaryimage","url":"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/Function-Block-Program-Simulation.png","contentUrl":"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2023\/03\/Function-Block-Program-Simulation.png","width":1365,"height":679,"caption":"Function Block Program Simulation"},{"@type":"BreadcrumbList","@id":"https:\/\/instrumentationtools.com\/functions-in-plc-programming\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/instrumentationtools.com\/"},{"@type":"ListItem","position":2,"name":"What are Functions in PLC Programming? (FCs)"}]},{"@type":"WebSite","@id":"https:\/\/instrumentationtools.com\/#website","url":"https:\/\/instrumentationtools.com\/","name":"Instrumentation Tools","description":"Instrumentation, Electrical, PLC, Tutorials","publisher":{"@id":"https:\/\/instrumentationtools.com\/#organization"},"alternateName":"Inst Tools","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/instrumentationtools.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/instrumentationtools.com\/#organization","name":"Instrumentation Tools","alternateName":"Inst Tools","url":"https:\/\/instrumentationtools.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/instrumentationtools.com\/#\/schema\/logo\/image\/","url":"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2018\/10\/Instrumentation-Tools-Logo.png","contentUrl":"https:\/\/instrumentationtools.com\/wp-content\/uploads\/2018\/10\/Instrumentation-Tools-Logo.png","width":1024,"height":1024,"caption":"Instrumentation Tools"},"image":{"@id":"https:\/\/instrumentationtools.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/instrumentationtoolss\/","https:\/\/x.com\/insttools","https:\/\/mastodon.social\/@InstrumentationTools","https:\/\/www.linkedin.com\/company\/instrumentationtools\/","https:\/\/whatsapp.com\/channel\/0029VaAbUecLNSa4rDPOV31o","https:\/\/t.me\/+u3qORX5FKec1NjA1","https:\/\/www.instagram.com\/instrumentationtools\/","https:\/\/youtube.com\/instrumentationtools"]},{"@type":"Person","@id":"https:\/\/instrumentationtools.com\/#\/schema\/person\/21192a950c6d97eae4517ff0153e7eb6","name":"Mahmoud Salama","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8c5c90be32d507b5003130bbdf6ef7d54d4f8943dd3712ffaf286c5f44cc15f7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8c5c90be32d507b5003130bbdf6ef7d54d4f8943dd3712ffaf286c5f44cc15f7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8c5c90be32d507b5003130bbdf6ef7d54d4f8943dd3712ffaf286c5f44cc15f7?s=96&d=mm&r=g","caption":"Mahmoud Salama"},"description":"Experienced Electrical Maintenance Engineer with over 7 years of experience. Skilled in PLC, SCADA, and HMI programming in many platforms(TIA-Portal on top).","url":"https:\/\/instrumentationtools.com\/author\/mahmoud-salama\/"}]}},"_links":{"self":[{"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/posts\/58058","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/users\/101030"}],"replies":[{"embeddable":true,"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/comments?post=58058"}],"version-history":[{"count":0,"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/posts\/58058\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/media\/58074"}],"wp:attachment":[{"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/media?parent=58058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/categories?post=58058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/instrumentationtools.com\/wp-json\/wp\/v2\/tags?post=58058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}