{"id":254,"date":"2022-04-05T19:43:45","date_gmt":"2022-04-05T19:43:45","guid":{"rendered":"https:\/\/mitechservices.ca\/MITS\/?page_id=254"},"modified":"2024-01-02T01:04:45","modified_gmt":"2024-01-02T01:04:45","slug":"plc-part-2-programming-codesys","status":"publish","type":"page","link":"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/","title":{"rendered":"PLC Part 2 Intro To CODESYS"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Welcome to the next level in our learning series. The subject is an introduction to CODESYS.  This is the software that has been selected for this training because it adheres to the industry standard for PLC programing languages. That makes it a great choice when we progress to learning Ladder Diagram later is the series. What is learned here should be re-applicable when programming other types of PLCs. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The prerequisite for this material is our first learning series, <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-1-fundamentals\/\">PLC Part 1 The Fundamentals<\/a>. Something else that may help, take a look at the setup for a <a rel=\"noreferrer noopener\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/\" target=\"_blank\">DIY PLC Training Station<\/a>. The addressing and I\/O mapping referenced in this series are based on the  <a rel=\"noreferrer noopener\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/\" target=\"_blank\">DIY PLC Training Station<\/a> described. Exercises later in the series  are designed to work with the training station described but you can cover a lot of the material using the CODESYS built in simulator if you chose.  <\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"alignright size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"250\" height=\"173\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Chalkboard-PLC-CODESYS.png\" alt=\"Intro to CODESYS\" class=\"wp-image-816\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Chalkboard-PLC-CODESYS.png 250w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Chalkboard-PLC-CODESYS-100x69.png 100w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Chalkboard-PLC-CODESYS-150x104.png 150w\" sizes=\"auto, (max-width: 250px) 85vw, 250px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">To get an idea what&#8217;s covered here, take a peek at the table of contents. You&#8217;ll see that the beginning is a discussion on why CODESYS is the software selected for this training. At the end you will be learning about PLC addresses and getting ready to move on to actual programming.<br><\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a1524c7ae1cb\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a1524c7ae1cb\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Introduction\" >Introduction<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Relationship_Between_Inputs_Logic_And_Outputs\" >Relationship Between Inputs, Logic And Outputs<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Intro_To_The_CODESYS_Development_System\" >Intro To The CODESYS Development System<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#CODESYS_Development_System\" >CODESYS Development System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#CODESYS_Control_Win_Soft_PLC\" >CODESYS  Control Win Soft PLC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Exercise_1_%E2%80%93_Install_CODESYS_On_Your_PC\" >Exercise 1 &#8211; Install CODESYS On Your PC<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Download\" >Download<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#i\" >&nbsp;<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Install\" >Install<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Exercise_2_%E2%80%93_Create_New_Project\" >Exercise 2 &#8211; Create New Project<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Menu_Bar\" >Menu Bar<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Tool_Bar\" >Tool Bar<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Devices_View\" >Devices View<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Toolbox\" >Toolbox<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Message_Window\" >Message Window<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Status_Bar\" >Status Bar<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Upper_Right_Corner\" >Upper Right Corner<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Start_Page\" >Start Page<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Workspace_And_Editor\" >Workspace And Editor<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-20\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Save_Project\" >Save Project<\/a><\/li><\/ul><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Objects\" >Objects<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Project\" >Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-23\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Device\" >Device<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-24\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#PLC_Logic_and_Application\" >PLC Logic and Application<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Library_Manager\" >Library Manager<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Program_Organization_Unit_POU\" >Program Organization Unit (POU)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Task_Configuration_and_Tasks\" >Task Configuration and Tasks<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-28\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#PLC_IO_Configuration\" >PLC I\/O Configuration<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-29\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Exercise_3_%E2%80%93_Add_Slave_Device_Modbus_Config_To_Project\" >Exercise 3 &#8211; Add Slave Device Modbus Config To Project<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-30\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Addresses\" >Addresses &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-31\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#Memory_Overlap\" >Memory Overlap<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-32\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#IO_Mapping\" >I\/O Mapping<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-33\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#References_%E2%80%93_Books_And_Weblinks\" >References &#8211; Books And Weblinks<\/a><\/li><\/ul><\/nav><\/div>\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Introduction\"><\/span>Introduction<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">To begin learning how to program. we need programming software that is compatible with our PLC and a language must be selected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are 5 standard PLC languages to choose from. Ladder Diagram is a popular choice. It was developed to resemble electrical diagrams that technicians and electricians are already familiar with. The intent of this training document is to teach the principles of programming with Ladder Diagram.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">There are many PLCs and compatible software from many vendors to chose from. Some more popular than others. A manufacturer&#8217;s specific programming software may or may not adhere to the industry standard and learning that system will prepare the student to work, primarily, with devices provided by one manufacturer. Programming software that adheres to the industry standard and works with multiple PLCs would seem ideal. The CODESYS Development System fits that description. It has been chosen for this training because what we learn from CODESYS is most likely re-applicable to multiple PLCs and their compatible software.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The best PLC training classes have a strong hands-on approach. Usually with PLC hardware available in the form of a training Station, with real I\/O, to perform lab exercises. In the section <em><em><a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/\" target=\"_blank\" rel=\"noreferrer noopener\">DIY PLC Training Station<\/a><\/em><\/em> instructions are provided to create a PLC trainer. It is made up of a Soft PLC application, installed on a PC, to serve as the CPU and an inexpensive microcontroller board is connected for I\/O. <\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"268\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DIT-Training-Station-1.jpg\" alt=\"\" class=\"wp-image-452\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DIT-Training-Station-1.jpg 598w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DIT-Training-Station-1-300x134.jpg 300w\" sizes=\"auto, (max-width: 598px) 85vw, 598px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The CODESYS Development System comes with a built in PLC simulator. Though the exercises are designed to work with the training station, it is an option to perform the exercises in the simulation environment. The difference is, the simulation does not provide real I\/O. For a description of <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-3-basic-ladder-diagram\/#exercise-5\" target=\"_blank\" rel=\"noreferrer noopener\" title=\"how to work the CODESYS simulator\">how to work the CODESYS simulator<\/a> see Exercise 5.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once again, the intent of this documentation is to help people get started programming PLCs with ladder logic. It is not likely that it will make anyone into a CODESYS Guru. There are many features of the CODESYS Development System that are not covered here. However, it is a starting point, and the door is always open to learn more by self study.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Relationship_Between_Inputs_Logic_And_Outputs\"><\/span>Relationship Between Inputs, Logic And Outputs<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">When we <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-1-fundamentals\/#basic-parts\">learn the basic parts of a PLC system<\/a>, we discover there are input and output sections. Switching devices are connected to the input section to feed information to the system. Load devices are connected to the output section to perform actions controlled by the system. What lies in between, processing the information and deciding on the actions, is logic. The logic of course resides in the CPU. It is the loaded application that was programmed by the PLC user.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"486\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-Working-Pricipal-1024x486.jpg\" alt=\"\" class=\"wp-image-453\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-Working-Pricipal-1024x486.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-Working-Pricipal-300x142.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-Working-Pricipal-768x365.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-Working-Pricipal.jpg 1038w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\" id=\"plc-scan\">The interactions between the I\/O and the CPU happen on cyclical basis during the PLC Scan. The diagram titled <em>Typical Synchronous PLC Scan<\/em> illustrates the order of the interactions for most PLCs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When a PLC is powered on, the CPU processor will perform a start-up status check. If a defect is detected the PLC scan will not start and a warning light or other status indicator will give a fault signal. Assuming the start-up check goes OK then the initial PLC scan will commence.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&nbsp;Step 1 is to read the status of the connected, real world, inputs. That data will be stored in the memory that is assigned for inputs. Then on to the next step.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 2 is to execute the logic that has been written and loaded to the PLC. The input data that was stored in memory, during step 1, is taken into account as the program is interpreted and a decision made for each output. The updated output states are stored in the memory that is assigned for outputs. Then on to the next step.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Step 3 uses the output data that was stored in step 2 to update the real-world outputs that control the connected output devices. Then step 3 is complete.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some of the processor scan time is dedicated to housekeeping duties but it is the 3-step process that was just described that does the real work. The scan is continuous and repeated every few milliseconds. It happens fast enough that the interaction between inputs and outputs would seem instant as perceived by human senses.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But, none of this can happen without the loaded application that was programmed by the PLC user. To create the application we need to learn a language to program PLCs.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"719\" height=\"532\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-Scan.jpg\" alt=\"\" class=\"wp-image-454\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-Scan.jpg 719w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-Scan-300x222.jpg 300w\" sizes=\"auto, (max-width: 719px) 85vw, 719px\" \/><\/figure>\n<\/div>\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Intro_To_The_CODESYS_Development_System\"><\/span>Intro To The CODESYS Development System<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The name CODESYS is a contraction for Controller Development System<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CODESYS_Development_System\"><\/span>CODESYS Development System <span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In general, to learn PLC programming, using the CODESYS Development System is a great way to start. CODESYS is a provider of manufacturer-independent automation software, so it is not limited to just one PLC platform. It is used by multiple PLC vendors. Festo, Eaton, Opto22 and Wago are just a few of the vendors with CODESYS compatible PLCs. Soft PLC runtimes are also available for platforms like Industrial PCs and other programmable automation devices. <a href=\"https:\/\/www.codesys.com\/the-system\/codesys-inside.html\" target=\"_blank\" rel=\"noreferrer noopener\">To see a list of compatible PLCs click here<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">CODESYS conforms to IEC 61131-3. That is the industry standard for PLC programming languages. That means standard PLC languages are supported. There are 5 standard languages according to IEC 61131-3, made up of:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">3 Graphic Languages<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ladder Diagram (LD)<\/li>\n\n\n\n<li>Sequential Function Chart (SFC)<\/li>\n\n\n\n<li>Function Block Diagram (FBD)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">2 Textual Languages<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Instruction List (IL)<\/li>\n\n\n\n<li>Structured Text (ST)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">A textual language relies on text like words, punctuation, or numbers. The characters are arranged according to a given syntax to build the program statements and expressions. The syntax is the set of rules that determines what combinations of characters have meaning in the programming language.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Graphic languages provide a more visual interface. Symbols like, lines, blocks and shapes draw a picture of the statements and expressions, instead of relying on text alone.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Since CODESYS supports the standard languages, much of what you learn here can be applied to other types of PLCs. This is certainly the case with the LD language that this training will focus on.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"codesys-control-win\"><span class=\"ez-toc-section\" id=\"CODESYS_Control_Win_Soft_PLC\"><\/span>CODESYS  Control Win Soft PLC<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When you download and install the CODESYS Development System a soft PLC called CODESYS Control Win is included in the bundle. A soft PLC is software you can run on a computer that will function as a PLC processor. The benefit of the soft PLC, when leaning, is that you can run PLC applications that you develop in a real PLC environment without the cost of purchasing a PLC processor. In demo mode, the soft PLC runs for 2-hour intervals, with full features, without a license. After the 2-hour limit the soft PLC must be restarted.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can learn more about CODESYS by visiting the website.&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;<a href=\"https:\/\/www.codesys.com\/\">https:\/\/www.codesys.com\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Exercise_1_%E2%80%93_Install_CODESYS_On_Your_PC\"><\/span>Exercise 1 &#8211; Install CODESYS On Your PC<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Skip this exercise if you have already setup the training station described in section <em><em><em><a rel=\"noreferrer noopener\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/\" target=\"_blank\">DIY PLC Training Station<\/a><\/em><\/em><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the CODESYS soft PLC and development system are not already installed on your PC you will have to download from the CODESYS website. It will be required to select between a 32 bit or 64 bit version. The 64 bit version is not suitable for a 32 bit PC. You will need to know ahead of time, what type of OS is on your PC. If you need to know how to check what version is installed, see the guide <em><a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/#Check-properties\" target=\"_blank\" rel=\"noreferrer noopener\">Check Properties On Your PC<\/a><\/em> in the <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/\" target=\"_blank\" rel=\"noreferrer noopener\">Help Section<\/a>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Download\"><\/span>Download<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Software is available from the CODESYS Store website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In Canada, USA and Mexico go to&nbsp; <a href=\"https:\/\/us.store.codesys.com\/\">https:\/\/us.store.CODESYS.com\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Everywhere else, go to <a href=\"https:\/\/store.codesys.com\/de\/\">https:\/\/store.CODESYS.com\/de\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An account is required and must be signed in to download. From the CODESYS Store website. Click on Sign In at the upper right of the screen. This will take you to the customer login screen.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"932\" height=\"181\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/welcom-to-codesys-store.jpg\" alt=\"\" class=\"wp-image-457\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/welcom-to-codesys-store.jpg 932w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/welcom-to-codesys-store-300x58.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/welcom-to-codesys-store-768x149.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">From the customer login screen, you have options:<\/p>\n\n\n\n<figure class=\"wp-block-table aligncenter\"><table><tbody><tr><td>If you have an account, enter your email and password then sign in.<br><br><br>          <img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"42\" class=\"wp-image-458\" style=\"width: 100px;\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/sign-in-button.jpg\" alt=\"\"><\/td><td class=\"has-text-align-left\" data-align=\"left\">If you do not have an account, then click to create one as a company or individual.<br>       <img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"90\" class=\"wp-image-459\" style=\"width: 300px;\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/create-account-buttons.jpg\" alt=\"\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/create-account-buttons.jpg 411w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/create-account-buttons-300x90.jpg 300w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/> &nbsp; <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Once registered and signed in you will return to the CODESYS Store page. From here you can select to download the 32 bit or 64 bit version.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1021\" height=\"277\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/32-or-64-cocesys.jpg\" alt=\"\" class=\"wp-image-462\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/32-or-64-cocesys.jpg 1021w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/32-or-64-cocesys-300x81.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/32-or-64-cocesys-768x208.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">When you select a version to download, the licence agreement will appear. After reading the agreement, you must accept the terms to continue with the download. The download location will vary depending on your browser and your chosen setup.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"i\"><\/span><a>&nbsp;<\/a><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install\"><\/span>Install<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">From the file\u2019s download location or wherever you chose to move it, open the file to start the installation. Alternately you can double-click it or, if you are not logged in to an administrator account, you may have to select Run as administrator. Follow the prompts to continue the installation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"891\" height=\"429\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/OPEN-CODESYS-INSTALL-FILE.jpg\" alt=\"\" class=\"wp-image-485\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/OPEN-CODESYS-INSTALL-FILE.jpg 891w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/OPEN-CODESYS-INSTALL-FILE-300x144.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/OPEN-CODESYS-INSTALL-FILE-768x370.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">When you are prompted to select the setup type, select Complete. This installs the full bundle including the CODESYS Control Win soft PLC.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"545\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/CODESYE-Complete-setup.jpg\" alt=\"\" class=\"wp-image-487\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/CODESYE-Complete-setup.jpg 806w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/CODESYE-Complete-setup-300x203.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/CODESYE-Complete-setup-768x519.jpg 768w\" sizes=\"auto, (max-width: 806px) 85vw, 806px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Continue following the prompts to complete the installation. At that point, the necessary CODESYS software will have been installed on your PC.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This concludes Exercise 1.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"exercise-2\"><span class=\"ez-toc-section\" id=\"Exercise_2_%E2%80%93_Create_New_Project\"><\/span>Exercise 2 &#8211; Create New Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To get a first look at the CODESYS Development System we will describe step by step how to create a new project and save it. Explaining a few things along the way.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the Development System is installed on your PC, then you can start it:<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"474\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/start-codesys.jpg\" alt=\"\" class=\"wp-image-488\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/start-codesys.jpg 1000w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/start-codesys-300x142.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/start-codesys-768x364.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The diagram titled <em>Initial Display<\/em> shows how CODESYS is presented, by default, at start-up. Components of the display are labelled in red text.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"673\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/initial-dispaly-1024x673.jpg\" alt=\"\" class=\"wp-image-1329\" style=\"width:956px;height:auto\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/initial-dispaly-1024x673.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/initial-dispaly-300x197.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/initial-dispaly-768x504.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/initial-dispaly-100x66.jpg 100w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/initial-dispaly-150x99.jpg 150w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/initial-dispaly.jpg 1058w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Menu_Bar\"><\/span>Menu Bar<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The Menu Bar is a familiar convention in windows-based applications. Clicking on the Menu Bar opens dropdown menus for categories: File, Edit, View, Project, Build, Online, Tools, Windows and Help. This provides extensive access to all menu commands.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A good way to get more information on each command is to select a dropdown menu, hover the mouse pointer over a command and press the F1 button on the keyboard. This will open online help for the command you have queried.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"692\" height=\"719\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/menu-bar-help.jpg\" alt=\"\" class=\"wp-image-492\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/menu-bar-help.jpg 692w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/menu-bar-help-289x300.jpg 289w\" sizes=\"auto, (max-width: 692px) 85vw, 692px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Tool_Bar\"><\/span>Tool Bar<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The Tool Bar is another familiar Windows convention. It is made up of symbols that provide quick, click on, access to frequently used menu commands.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A good way to get more information on each symbol is to hover the mouse pointer above until the name of the command appears.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"670\" height=\"174\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/toolbar-help.jpg\" alt=\"\" class=\"wp-image-494\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/toolbar-help.jpg 670w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/toolbar-help-300x78.jpg 300w\" sizes=\"auto, (max-width: 670px) 85vw, 670px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">For a more detailed description, hover the mouse pointer over the symbol and press the F1 button on the keyboard. This will open online help for the associated command<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"682\" height=\"458\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/toolbar-help2.jpg\" alt=\"\" class=\"wp-image-495\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/toolbar-help2.jpg 682w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/toolbar-help2-300x201.jpg 300w\" sizes=\"auto, (max-width: 682px) 85vw, 682px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Devices_View\"><\/span>Devices View<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A window to the left is known as the Devices View. When a new project is created, an hierarchical list is created that shows the devices and objects that make up the project. List items will appear as a tree structure that can be expanded or collapsed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Toolbox\"><\/span>Toolbox<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The toolbox window, to the right, provides the tools for graphical languages. When actively working with a graphical program editor, like ladder, a list of program elements will appear that can be used on a drag and drop basis.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Message_Window\"><\/span>Message Window<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The Message Window is towards the bottom of the display, in auto hide mode. The box will open to display relevant errors, warnings and status updates. Message are generated related to search results, cross-references, checks, comparisons or compiling.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Status_Bar\"><\/span>Status Bar<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The status bar is at the very bottom of the display. It provides information regarding CODESYS current actions. There are indicators to show project status for simulation mode, online, run, stop, how many errors or warning among other things.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Upper_Right_Corner\"><\/span>Upper Right Corner<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To the upper right of the screen are the usual gadgets <img loading=\"lazy\" decoding=\"async\" width=\"100\" height=\"36\" class=\"wp-image-496\" style=\"width: 100px;\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/window-gadjets.jpg\" alt=\"\">&nbsp;&nbsp;performing the normal functions to minimize, maximize, change the size, or exit the application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Start_Page\"><\/span>Start Page<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To the center of the initial display is the Start Page. The Start Page offers the options to open a new project or open an existing project. The existing project could be from listed recent projects, opened from the PLC or select Open Project to access any location available to the PC.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Returning to our objective, to create a new project, we will select New Project from the Start Page.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"744\" height=\"512\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/select-new-project.jpg\" alt=\"\" class=\"wp-image-498\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/select-new-project.jpg 744w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/select-new-project-300x206.jpg 300w\" sizes=\"auto, (max-width: 744px) 85vw, 744px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">From the New Project dialog box, different templates are available. For this example, we will select Standard Project. The Standard Project template creates a project with the objects we need to develop a basic PLC application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is also where the project is given a name and a location to store the file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the selections have been made, its time to click OK.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"512\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/new-project-dialog.jpg\" alt=\"\" class=\"wp-image-499\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/new-project-dialog.jpg 826w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/new-project-dialog-300x186.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/new-project-dialog-768x476.jpg 768w\" sizes=\"auto, (max-width: 826px) 85vw, 826px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The Standard Project template initiates a wizard to assist with project creation. The type of device and PLC language must be selected from the dropdown lists. Select a version of the CODESYS Control Win Soft PLC as the device. Think back to when we installed the CODESYS software. Did you install the 32 bit or 64 bit version. You need to select the device accordingly. If you need to know how to check what version is installed, see the guide <em><a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/#Check-what-version\" target=\"_blank\" rel=\"noreferrer noopener\">Check What Version Of CODESYS Control Win Soft PLC Is Installed<\/a><\/em> in the <a rel=\"noreferrer noopener\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/\" target=\"_blank\">Help Section<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For this example, the language will be ladder logic.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the selections are made clicking OK will create the project.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"608\" height=\"363\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Codesys-device-32-bit.jpg\" alt=\"\" class=\"wp-image-501\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Codesys-device-32-bit.jpg 608w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Codesys-device-32-bit-300x179.jpg 300w\" sizes=\"auto, (max-width: 608px) 85vw, 608px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"595\" height=\"359\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Codesys-device-64-bit.jpg\" alt=\"\" class=\"wp-image-502\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Codesys-device-64-bit.jpg 595w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Codesys-device-64-bit-300x181.jpg 300w\" sizes=\"auto, (max-width: 595px) 85vw, 595px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">When the project has been created it will appear as shown in the diagram titled <em>New Project<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To the left in the Devices View, objects related to the project appear in a tree structure.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Start Page is no longer available in the center of the display. This range will be dedicated as the Workspace when object editing begins.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"479\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/newproject-1024x479.jpg\" alt=\"\" class=\"wp-image-504\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/newproject-1024x479.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/newproject-300x140.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/newproject-768x360.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/newproject.jpg 1164w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Workspace_And_Editor\"><\/span>Workspace And Editor<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To get a better look at the Workspace, double click the object titled PLC_PRG (PRG) to open the associated editor.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"620\" height=\"294\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-PLC_PRG-editor.jpg\" alt=\"\" class=\"wp-image-505\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-PLC_PRG-editor.jpg 620w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-PLC_PRG-editor-300x142.jpg 300w\" sizes=\"auto, (max-width: 620px) 85vw, 620px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The diagram titled <em>New Project Ladder Editor<\/em> shows the project with editors open in the workspace. An area called the Declaration Editor appears in the upper part of the Workspace. This is where variables for PLC_PRG (PRG) will be declared.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The Ladder Editor takes up the bottom area of the Workspace. This is where the ladder programming will happen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"501\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/New-Project-Ladder-Editor-1024x501.jpg\" alt=\"\" class=\"wp-image-506\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/New-Project-Ladder-Editor-1024x501.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/New-Project-Ladder-Editor-300x147.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/New-Project-Ladder-Editor-768x376.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/New-Project-Ladder-Editor.jpg 1181w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Save_Project\"><\/span>Save Project<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To complete the test drive, all that remains is to save the project. A couple of different ways are:<\/p>\n\n\n\n<div class=\"wp-block-columns are-vertically-aligned-top is-layout-flex wp-container-core-columns-is-layout-8f761849 wp-block-columns-is-layout-flex\">\n<div class=\"wp-block-column is-vertically-aligned-top is-layout-flow wp-block-column-is-layout-flow\" style=\"flex-basis:100%\">\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td>Click the File dropdown menu and select Save Project<br><br>  <img loading=\"lazy\" decoding=\"async\" width=\"350\" height=\"197\" class=\"wp-image-509\" style=\"width: 350px;\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-new-project.jpg\" alt=\"\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-new-project.jpg 518w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-new-project-300x169.jpg 300w\" sizes=\"auto, (max-width: 350px) 85vw, 350px\" \/><\/td><td>Or, click the Save symbol that resembles a floppy disk. <br>&nbsp; <br>    <img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"154\" class=\"wp-image-510\" style=\"width: 300px;\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-new-project2.jpg\" alt=\"\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-new-project2.jpg 490w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-new-project2-300x154.jpg 300w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/><br><\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div><\/div>\n<\/div>\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\">This concludes Exercise 2.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Objects\"><\/span>Objects<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">We had a glimpse of the Devices View when we created a new project. In the Devices View we could see project objects arranged in a tree structure.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"441\" height=\"354\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Objects-In-Device-View.jpg\" alt=\"\" class=\"wp-image-513\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Objects-In-Device-View.jpg 441w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Objects-In-Device-View-300x241.jpg 300w\" sizes=\"auto, (max-width: 441px) 85vw, 441px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Let\u2019s take a closer look at the objects of a typical project to understand what they are for.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Project\"><\/span>Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">At the top of the tree there is a folder with the project name. When it is expanded, the project\u2019s child objects come into view.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"395\" height=\"74\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Object-Project.jpg\" alt=\"\" class=\"wp-image-514\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Object-Project.jpg 395w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Object-Project-300x56.jpg 300w\" sizes=\"auto, (max-width: 395px) 85vw, 395px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Device\"><\/span>Device<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Device is a child object of the project. It represents the type of PLC or automation device that the project is configured for. If we were using a PLC from a specific manufacturer, the model number might appear in the label. We are using the CODESYS Control Win soft PLC&nbsp; loaded on our PC for this example. When it is expanded, child objects of the device come into view.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"729\" height=\"108\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-device.jpg\" alt=\"\" class=\"wp-image-515\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-device.jpg 729w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-device-300x44.jpg 300w\" sizes=\"auto, (max-width: 729px) 85vw, 729px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PLC_Logic_and_Application\"><\/span>PLC Logic and Application<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The PLC Logic object is a child of the device. The PLC Logic is the programmable branch of the PLC or automation device. So, it is natural that the Application object is immediately below. It is possible to have multiple Application objects but our example just has the one. The Application object groups together components that make up an executable control program that will be complied into downloadable PLC code. When the Application object it is expanded, related child objects come into view.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"381\" height=\"133\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-application.jpg\" alt=\"\" class=\"wp-image-516\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-application.jpg 381w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-application-300x105.jpg 300w\" sizes=\"auto, (max-width: 381px) 85vw, 381px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Library_Manager\"><\/span>Library Manager<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Library Manager object is a child of the application. Libraries are files that contain computer code that the computer uses to create the application. The Library Manager can group together multiple libraries. Viewing Library Manager Properties can show all libraries connected to the application. It can also add or delete libraries..<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"396\" height=\"86\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-library-manager.jpg\" alt=\"\" class=\"wp-image-517\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-library-manager.jpg 396w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-library-manager-300x65.jpg 300w\" sizes=\"auto, (max-width: 396px) 85vw, 396px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Program_Organization_Unit_POU\"><\/span>Program Organization Unit (POU)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The POU is a child of the application. The POU is probably the most important object to us for this training. POUs are where the PLC programming happens. A POU can be a program, function, or function block. When a CODESYS standard project is created a program type POU is generated and automatically titled PLC_PRG.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Remember the diagram <em>New Project Ladder Editor<\/em> from when we were exploring the workspace in the middle of the main display. We opened the editor for the POU named PLC_PRG. It was noted that within the PLC_PRG that there was an area to edit declarations and an area to edit ladder logic. It is true for all POUs that there is an area for declarations and an area for logic programed with the selected PLC language.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"395\" height=\"81\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-POU.jpg\" alt=\"\" class=\"wp-image-518\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-POU.jpg 395w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-POU-300x62.jpg 300w\" sizes=\"auto, (max-width: 395px) 85vw, 395px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The object display identifies the POU type in brackets after the title.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>(PRG) for Program<\/li>\n\n\n\n<li>(FB) for Function Block<\/li>\n\n\n\n<li>(FUN) for Function<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">POUs have different symbols for different languages.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"672\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/POU-Icons.jpg\" alt=\"\" class=\"wp-image-519\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/POU-Icons.jpg 788w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/POU-Icons-300x256.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/POU-Icons-768x655.jpg 768w\" sizes=\"auto, (max-width: 788px) 85vw, 788px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">There can be multiple Program Organization Units within an application. For a more complex project it can be beneficial to separate different parts of the logic into several POUs to keep it organized. &nbsp;For our example we just have the one POU.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Task_Configuration_and_Tasks\"><\/span>Task Configuration and Tasks<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"650\" height=\"186\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-tasks.jpg\" alt=\"\" class=\"wp-image-555\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-tasks.jpg 650w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/object-tasks-300x86.jpg 300w\" sizes=\"auto, (max-width: 650px) 85vw, 650px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The Task Configuration is a child to the application. The POU may be where the logic is, but it is the Task that controls whether the logic is executed and when. Every task is assigned a type that determines when the task is triggered. The different task types are:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Cyclic \u2013 The task is triggered based on a set time interval. The default interval is 20ms. If the set interval is 20 ms then the task is triggered repeatedly every 20ms.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Freewheeling \u2013 The task is triggered continuously, for every program scan, with no waiting interval.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Event \u2013 The task is triggered at the rising edge of an assigned variable.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Status \u2013 The task is triggered when an assigned variable is at the Boolean value, TRUE.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Tasks are also assigned a priority. If 2 tasks, based on their types, were poised to trigger at the same time then the one with the highest priority would go first.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Task are configured to call selected programs (program type POUs). So, when a task is triggered, the configured programs will execute. It is in this manner that the tasks control the order of program execution. To clarify the order of things, a task can call a program, a program can call a program, a function or function block.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An application can have multiple Tasks. Task objects will appear as child objects to the Task Configuration object.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our example has only one task. It is a cyclic type with an interval of 20ms.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By the way, you may have noticed when our single task (MainTask) is expanded, the program PLC_Prg appears as a child object to the task. You may recall we have already seen a POU named PLC_Prg as a child object to the application. This is not a separate program that happens to have the same name. It shows that the POU is called by the task. When a standard project is created, PLC_PRG is added to the call list by default. When it is visible here, we know that PLC_Prg will execute when the task is triggered.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"603\" height=\"390\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC_PRG-2-places.jpg\" alt=\"\" class=\"wp-image-556\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC_PRG-2-places.jpg 603w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC_PRG-2-places-300x194.jpg 300w\" sizes=\"auto, (max-width: 603px) 85vw, 603px\" \/><\/figure>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"PLC_IO_Configuration\"><\/span>PLC I\/O Configuration<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/#exercise-2\">In Exercise 2<\/a>, we created a project for CODESYS Control Win soft PLC, but that project has no I\/O. To make inputs and outputs accessible to the soft PLC, devices will be added to the Devices View. For the next exercise we will be setting up a configuration for a slave device that uses the Modbus protocol. It is compatible with the training station described in the section <em><a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/\" target=\"_blank\" rel=\"noreferrer noopener\">DIY PLC Training Station<\/a><\/em>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"exercise-3\"><span class=\"ez-toc-section\" id=\"Exercise_3_%E2%80%93_Add_Slave_Device_Modbus_Config_To_Project\"><\/span>Exercise 3 &#8211; Add Slave Device Modbus Config To Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Skip this exercise if you have already setup the training station described in the section <em><a rel=\"noreferrer noopener\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/\" target=\"_blank\">DIY PLC Training Station<\/a><\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To begin, we will save our project, \u201cMyFirstProject\u201d, from Exercise 2 with a new name. So, make sure you have <strong>saved the project<\/strong> \u201cMyFirstProject\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the project \u201cMyFirstProject\u201d open, from the File menu select Save Project As.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save with new name \u201cTraining_Station_Base\u201d.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"542\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Save-as-Traning-station-base-1024x542.jpg\" alt=\"\" class=\"wp-image-559\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Save-as-Traning-station-base-1024x542.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Save-as-Traning-station-base-300x159.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Save-as-Traning-station-base-768x406.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Save-as-Traning-station-base.jpg 1068w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">To begin the I\/O configuration, right click the Device object and select Add Device.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"794\" height=\"669\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-device.jpg\" alt=\"\" class=\"wp-image-400\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-device.jpg 794w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-device-300x253.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-device-768x647.jpg 768w\" sizes=\"auto, (max-width: 794px) 85vw, 794px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The Add Device dialog box will appear. Several types of Fieldbuses are available from here. A fieldbus is a means of communicating with I\/O devices. For our exercise we will be using Modbus.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Under the heading Modbus, double click Modbus COM to add the device. This sets up a COM port for Modbus communication. Then click on the X symbol at the upper right of the Add Device dialog box to close.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"846\" height=\"579\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device.jpg\" alt=\"\" class=\"wp-image-401\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device.jpg 846w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device-300x205.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device-768x526.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Next is setting of the COM port parameters. Double click the Modbus_COM object to open the object editor. Select the General tab to set the baud rate to 115200 and the parity to NONE. It is not likely that the slave device is connected at this point, so leave the COM port number at the default (1) for now.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If it so happens, you have already prepared and connected the slave device, the COM port number will be the COM port assigned to connect to the slave device via USB. You can confirm the COM port with the device manager. The method to check the device manger is in the<a rel=\"noreferrer noopener\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/\" target=\"_blank\"> Help Section<\/a>, titled <em><a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/#Check-Com-Port\" target=\"_blank\" rel=\"noreferrer noopener\">Check The COM Port In Windows Device Manager<\/a><\/em>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"387\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/modbus-com-settings-1024x387.jpg\" alt=\"\" class=\"wp-image-563\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/modbus-com-settings-1024x387.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/modbus-com-settings-300x113.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/modbus-com-settings-768x290.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/modbus-com-settings.jpg 1397w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Right click the Modbus_COM object and select Add Device.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"704\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device3a.jpg\" alt=\"\" class=\"wp-image-569\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device3a.jpg 728w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device3a-300x290.jpg 300w\" sizes=\"auto, (max-width: 728px) 85vw, 728px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Under the heading Modbus Serial Master double click Modbus Master, Com Port to add the device. This configures the soft PLC as the Master on the assigned COM port. Then click on the X symbol at the upper right of the Add Device dialog box to close.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"836\" height=\"498\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device3b.jpg\" alt=\"\" class=\"wp-image-575\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device3b.jpg 836w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device3b-300x179.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device3b-768x457.jpg 768w\" sizes=\"auto, (max-width: 836px) 85vw, 836px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Right click the Modbus_Master_COM_Port object and select Add Device.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"923\" height=\"709\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device5.jpg\" alt=\"\" class=\"wp-image-405\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device5.jpg 923w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device5-300x230.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device5-768x590.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Under the heading Modbus Serial Slave double click Modbus Slave, Com Port to add the device. This configures the slave device and gives access to set up the parameters of the slave device. Then click on the X symbol at the upper right of the Add Device dialog box to close.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"802\" height=\"468\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device6.jpg\" alt=\"\" class=\"wp-image-406\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device6.jpg 802w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device6-300x175.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device6-768x448.jpg 768w\" sizes=\"auto, (max-width: 802px) 85vw, 802px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Double click the Modbus_Slave_COM object to open the object editor. Select the Modbus Slave Channel and then select Add Channel to set up Channel 0.<\/p>\n\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"411\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel-1024x411.jpg\" alt=\"\" class=\"wp-image-407\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel-1024x411.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel-300x120.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel-768x308.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel.jpg 1276w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Channel 0 will be setup to read the 5 digital inputs from the slave device.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set the Parameters for Channel 0 as shown below. Then click OK to accept changes.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"647\" height=\"569\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel.1JPG.jpg\" alt=\"\" class=\"wp-image-408\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel.1JPG.jpg 647w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel.1JPG-300x264.jpg 300w\" sizes=\"auto, (max-width: 647px) 85vw, 647px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Select Add Channel to set up Channel 1.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"292\" height=\"129\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel2.jpg\" alt=\"\" class=\"wp-image-409\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Channel 1 will be setup to read the 6 analog inputs from the slave device. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set the Parameters for Channel 1 as shown below. Then click OK to accept changes<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"641\" height=\"574\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel3.jpg\" alt=\"\" class=\"wp-image-410\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel3.jpg 641w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel3-300x269.jpg 300w\" sizes=\"auto, (max-width: 641px) 85vw, 641px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Select Add Channel to set up Channel 2.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"292\" height=\"129\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel2.jpg\" alt=\"\" class=\"wp-image-409\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Channel 2 will be setup to write the 4 digital outputs to the slave device<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set the Parameters for Channel 2 as shown below. Then click OK to accept changes.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"585\" height=\"501\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel4.jpg\" alt=\"\" class=\"wp-image-411\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel4.jpg 585w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel4-300x257.jpg 300w\" sizes=\"auto, (max-width: 585px) 85vw, 585px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Select Add Channel to set up Channel 3.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"292\" height=\"129\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel2.jpg\" alt=\"\" class=\"wp-image-409\"\/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Channel 3 will be setup to write the 3 analog outputs to the slave device<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Set the Parameters for Channel 3 as shown below. Then click OK to accept changes.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"595\" height=\"520\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel5.jpg\" alt=\"\" class=\"wp-image-412\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel5.jpg 595w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-channel5-300x262.jpg 300w\" sizes=\"auto, (max-width: 595px) 85vw, 595px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">At this point the slave device configuration is completed. It is a good time to save the project.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This concludes Exercise 3.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Addresses\"><\/span>Addresses &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">PLCs have addressable memory. When the CPU was introduced as one of the <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-1-fundamentals\/#basic-parts\" target=\"_blank\" rel=\"noreferrer noopener\">basic parts of a PLC<\/a>, we learned that the CPU contains the system memory. The memory is broken into different ranges depending on the job it must do. By default, the CODESYS Control Win soft PLC has 4096 bytes for inputs, 4096 bytes for outputs and 4096 bytes of internal memory. To identify different parts of the memory an addressing system is required.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why do we need to know this? If we want to make use of the information coming from the real-world inputs or send data to control real-world outputs, we need to know what memory addresses are associated with each I\/O.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"807\" height=\"201\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/addresses-in-ladder-logic.jpg\" alt=\"\" class=\"wp-image-589\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/addresses-in-ladder-logic.jpg 807w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/addresses-in-ladder-logic-300x75.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/addresses-in-ladder-logic-768x191.jpg 768w\" sizes=\"auto, (max-width: 807px) 85vw, 807px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To identify a memory element, the addressing system for CODESYS uses letters to indicate memory range and size. Numbering is used to define the exact word, byte or bit within a memory range. The syntax dictates that all memory addresses have a \u201cpercent sign\u201d (%) at the beginning. The characters to define an address must be in a specific order.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"935\" height=\"131\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/typical-codesys-address.jpg\" alt=\"\" class=\"wp-image-591\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/typical-codesys-address.jpg 935w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/typical-codesys-address-300x42.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/typical-codesys-address-768x108.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"446\" height=\"359\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/address-decription.jpg\" alt=\"\" class=\"wp-image-595\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/address-decription.jpg 446w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/address-decription-300x241.jpg 300w\" sizes=\"auto, (max-width: 446px) 85vw, 446px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Addressing can vary depending on the PLC device and configuration. Particularly when defining addresses at the bit level. Depending on the device, the numbering may identify the byte number or word number and then a bit number separated by a dot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The examples given here are consistent with the CODESYS Control Win soft PLC with Modbus slave device from section <a rel=\"noreferrer noopener\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/\" target=\"_blank\">DIY PLC Training Station<\/a>. Like the one we are learning on.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Bit level addresses identify the <strong>byte<\/strong> number and then bit number after the dot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The diagram titled <em>Bit Level Input Address Example<\/em> shows a bit level address in the input range of memory where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>% (The percent sign) starts off the address<\/li>\n\n\n\n<li>I is for input range<\/li>\n\n\n\n<li>X is for size of 1 bit<\/li>\n\n\n\n<li>6 is the byte number<\/li>\n\n\n\n<li>2 is the bit number<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"856\" height=\"900\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/bit-level-address-example.jpg\" alt=\"\" class=\"wp-image-602\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/bit-level-address-example.jpg 856w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/bit-level-address-example-285x300.jpg 285w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/bit-level-address-example-768x807.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">For W word (16 bit) level addresses the word number is identified.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The diagram titled <em>Word Level Address Examples<\/em> shows a word level address in the internal memory (M) range of memory where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>% (The percent sign) starts off the address<\/li>\n\n\n\n<li>M is for internal memory range<\/li>\n\n\n\n<li>W is for word sized<\/li>\n\n\n\n<li>6 is the word number<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For D double word (32 bit)&nbsp; level addresses the Dword number is identified.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The diagram titled <em>Word Level Address Examples<\/em> shows a Dword level address in the internal memory (M) range of memory where:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>% (The percent sign) starts off the address<\/li>\n\n\n\n<li>M is for internal memory range<\/li>\n\n\n\n<li>D is for Dword sized<\/li>\n\n\n\n<li>4 is the Dword number<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"874\" height=\"689\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/word-level-address-exaple.jpg\" alt=\"\" class=\"wp-image-695\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/word-level-address-exaple.jpg 874w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/word-level-address-exaple-300x236.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/word-level-address-exaple-768x605.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/word-level-address-exaple-100x79.jpg 100w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/word-level-address-exaple-150x118.jpg 150w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To get used to the idea here are a few more addresses:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>%IX4.3 &nbsp;&nbsp;&nbsp;&nbsp;\u2013 Input Byte 4, Bit 3<\/li>\n\n\n\n<li>%QX8.7 &nbsp;&nbsp;&#8211; Output Byte 8. Bit 7<\/li>\n\n\n\n<li>%MD55&nbsp;&nbsp;&nbsp; &#8211; Memory DWord 55<\/li>\n\n\n\n<li>%MW30&nbsp;&nbsp; <a>&#8211;<\/a> Memory Word 30<\/li>\n\n\n\n<li>%MB5&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8211; Memory Byte 5<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Memory_Overlap\"><\/span>Memory Overlap<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Imagine that we were using the DWord address %MD1 for one purpose in the PLC and decided to assign Word address %MW2 to another part of an application. The addresses may be different but they both share a word of memory in the M memory range. Where %MD1 accesses the 3<sup>rd<\/sup> and 4<sup>th<\/sup> word of the memory range, %MW2 accesses the 3<sup>rd<\/sup> word as well. The 3<sup>rd<\/sup> word in the memory range is overlapped by both addresses. Data that is intended for one purpose could be corrupting data for another. It is important to assign addresses carefully to avoid these kinds of overlaps.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"574\" height=\"432\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DWORD-and-WORD-overlap.jpg\" alt=\"\" class=\"wp-image-698\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DWORD-and-WORD-overlap.jpg 574w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DWORD-and-WORD-overlap-300x226.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DWORD-and-WORD-overlap-100x75.jpg 100w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DWORD-and-WORD-overlap-150x113.jpg 150w\" sizes=\"auto, (max-width: 574px) 85vw, 574px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Imagine that we are using byte addresses %MB3 and %MB2 in a PLC program along with Word address %MW1. All 3 addresses are accessing the 2<sup>nd<\/sup> word of the memory range with one byte address pointing at the lower half and the other byte address pointing at the upper half. We have a similar overlap problem to the one we discussed with Words and Dwords.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"586\" height=\"427\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Byte-and-Word-overlap.jpg\" alt=\"\" class=\"wp-image-702\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Byte-and-Word-overlap.jpg 586w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Byte-and-Word-overlap-300x219.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Byte-and-Word-overlap-100x73.jpg 100w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Byte-and-Word-overlap-150x109.jpg 150w\" sizes=\"auto, (max-width: 586px) 85vw, 586px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">What if byte address %MB2 and DWord address %MD0 are both used? Would they overlap?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Be mindful that addresses at the bit level can overlap with elements of other sizes just like the overlaps we discussed for Word, DWord and Bytes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"IO_Mapping\"><\/span>I\/O Mapping<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To better understand what I\/O is assigned to what address, we can view an I\/O map of the CODESYS project. The I\/O map editor can be accessed by right clicking the Device object and then select Edit I\/O Mapping from the drop-down menu.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"782\" height=\"552\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/access-IO-editor.jpg\" alt=\"\" class=\"wp-image-703\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/access-IO-editor.jpg 782w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/access-IO-editor-300x212.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/access-IO-editor-768x542.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/access-IO-editor-100x71.jpg 100w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/access-IO-editor-150x106.jpg 150w\" sizes=\"auto, (max-width: 782px) 85vw, 782px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The I\/O map shown in the image titled <em>I\/O Map Of Project Training Station Base<\/em> is from the project created in section <em>DIY PLC Training Station<\/em>. The map shows all I\/O assigned to the project. In this case I\/O is connected via a Modbus slave device.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the description column we see Read Discrete Inputs. The description refers to the action performed by the Modbus protocol that interacts with the slave device. To the left of the description there are 5 bits assigned, %IX0.0&nbsp; to %IX0.4 for digital inputs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In similar fashion we see the description Read Input Registers. These are word addresses reserved for analog inputs. There are 6 words assigned, %IW1 to % IW6.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The description Write Multiple Coils refers to digital outputs. 4 bits are assigned, %QX0.0 to %QX0.3.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The description Write Multiple Registers refers to the analog outputs. 3 words are assigned, %QW1 to %QW3.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"657\" height=\"616\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/IO-Map-of-project.jpg\" alt=\"\" class=\"wp-image-704\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/IO-Map-of-project.jpg 657w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/IO-Map-of-project-300x281.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/IO-Map-of-project-100x94.jpg 100w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/IO-Map-of-project-150x141.jpg 150w\" sizes=\"auto, (max-width: 657px) 85vw, 657px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\" id=\"IO-connections\">The diagram titled <em>I\/O Connections<\/em> shows the Arduino slave device pinout with PLC addresses.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"601\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2023\/12\/IO-Connections-1024x601.png\" alt=\"\" class=\"wp-image-1269\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2023\/12\/IO-Connections-1024x601.png 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2023\/12\/IO-Connections-300x176.png 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2023\/12\/IO-Connections-768x451.png 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2023\/12\/IO-Connections-1536x902.png 1536w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2023\/12\/IO-Connections-100x59.png 100w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2023\/12\/IO-Connections-150x88.png 150w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2023\/12\/IO-Connections.png 1808w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Thank you for reading the learning series, PLC Part 2 Intro To CODESYS.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Click on this link to proceed to the next section <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-3-basic-ladder-diagram\/\">PLC Part 3 Basic Ladder Diagram<\/a>.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"References_%E2%80%93_Books_And_Weblinks\"><\/span>References &#8211; Books And Weblinks<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">You can explore more on the subjects discussed in PLC Part 2 Intro To CODESYS with these books links.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>CODESYS<\/strong> &#8211;&nbsp; Codesys help website &#8211;&nbsp; <a href=\"https:\/\/help.codesys.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/help.codesys.com\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Arduino Uno<\/strong> &#8211;&nbsp; Arduno Learn website &#8211;&nbsp; <a href=\"https:\/\/docs.arduino.cc\/learn\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/docs.arduino.cc\/learn\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Open PLC and Slave Device<\/strong> &#8211;&nbsp; Open PLC Project website &#8211;&nbsp; <a href=\"https:\/\/www.openplcproject.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.openplcproject.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Welcome to the next level in our learning series. The subject is an introduction to CODESYS. This is the software that has been selected for this training because it adheres to the industry standard for PLC programing languages. That makes it a great choice when we progress to learning Ladder Diagram later is the series. &hellip; <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/plc-part-2-programming-codesys\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;PLC Part 2 Intro To CODESYS&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":73,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-254","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/pages\/254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/comments?post=254"}],"version-history":[{"count":169,"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/pages\/254\/revisions"}],"predecessor-version":[{"id":1334,"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/pages\/254\/revisions\/1334"}],"up":[{"embeddable":true,"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/pages\/73"}],"wp:attachment":[{"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/media?parent=254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}