{"id":270,"date":"2022-04-11T21:24:20","date_gmt":"2022-04-11T21:24:20","guid":{"rendered":"https:\/\/mitechservices.ca\/MITS\/?page_id=270"},"modified":"2024-01-07T12:48:20","modified_gmt":"2024-01-07T12:48:20","slug":"diy-plc-training-station","status":"publish","type":"page","link":"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/","title":{"rendered":"DIY PLC Training Station"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This section is all about how to setup a PLC trainer with CODESYS and Arduino.<\/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-6a154433ed2ac\" 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-6a154433ed2ac\"  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\/diy-plc-training-station\/#Overview\" >Overview<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#CODESYS_Control_Win\" >CODESYS Control Win<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Arduino_UNO\" >Arduino UNO<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Install_CODESYS_On_Your_PC\" >Install CODESYS On Your PC<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Download\" >Download<\/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\/diy-plc-training-station\/#Install\" >Install<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Arduino_Board_Software\" >Arduino Board Software<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Download_and_Install_Arduino_IDE_On_Your_PC\" >Download and Install Arduino IDE 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-9\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Download-2\" >Download<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Install-2\" >Install<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Open_And_Setup_Arduino_IDE\" >Open And Setup Arduino IDE<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Acquire_The_Slave_Device_Sketch_and_Load_It_To_The_Arduino_Board\" >Acquire The Slave Device Sketch and Load It To The Arduino Board<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Download_The_Sketch\" >Download The Sketch<\/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\/diy-plc-training-station\/#How_was_the_Sketch_Modified\" >How was the Sketch Modified?<\/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\/diy-plc-training-station\/#Upload_to_Microcontroller_Board\" >Upload to Microcontroller Board<\/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-16\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Wiring_The_Arduino_Board\" >Wiring The Arduino Board<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Setup_The_Soft_PLC_For_Slave_Device\" >Setup The Soft PLC For Slave Device<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Create_New_Project\" >Create New Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-19\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Add_Slave_Device_Modbus_Config_To_Project\" >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-20\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Testing_The_PLC_Training_Station\" >Testing The PLC Training Station<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-21\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Communication_Settings_Connection_Path_To_PLC\" >Communication Settings Connection Path To PLC<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-22\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Connecting_To_PLC_Online_And_Download\" >Connecting To PLC Online And Download<\/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\/diy-plc-training-station\/#Starting_The_Application_And_Testing_Modbus\" >Starting The Application And Testing Modbus<\/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\/diy-plc-training-station\/#IO_Test\" >I\/O Test<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-25\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Create_Test_Project\" >Create Test Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-26\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#Connect_And_Download_Test_Project\" >Connect And Download Test Project<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-27\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/#IO_Checklist\" >I\/O Checklist<\/a><\/li><\/ul><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Overview\"><\/span>Overview<br><br><br><br><span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"598\" height=\"268\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DIT-Training-Station.jpg\" alt=\"\" class=\"wp-image-446\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DIT-Training-Station.jpg 598w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/DIT-Training-Station-300x134.jpg 300w\" sizes=\"auto, (max-width: 598px) 85vw, 598px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The intent of this documentation is to provide instructions to set up a PLC training station that can be used to practice PLC programming. When we learn the basics of PLCs, we discover 3 main components are the CPU (or processor), Inputs and Outputs (I\/O). So, it stands to reason that an effective PLC training station should have these things. The setup described here is intended to meet these requirements using a Soft PLC application installed on a PC as the processor and an inexpensive microcontroller board for I\/O. A PLC project is created with the required communication configuration and saved as a base project. The base project can serve as a starting point for each exercise or lab. With that base in place, simply open a copy of the base project, and then focus on learning programming instead of repeating the communication setup.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Items required for the PLC training station:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A PC to run the software for development and soft PLC. For this example, we are using a Windows 10 laptop.<\/li>\n\n\n\n<li>Arduino Uno R3 microcontroller board (or compatible) to connect our PLC to inputs and outputs.<\/li>\n\n\n\n<li>USB cable USB-A to USB-B to connect the PC to the Arduino board<\/li>\n\n\n\n<li>A Breadboard (830 tie points) with jumper wires to wire up the Arduino board.<\/li>\n\n\n\n<li>Resistors \u2013 5 X 10 Kohm and 5 X 220 ohm<\/li>\n\n\n\n<li>LEDs \u2013 1 each red, yellow, green, blue and white<\/li>\n\n\n\n<li>Push Button Switches \u2013 5 X Normally Open (NO), Gikfun Part # EK1019 or similar<\/li>\n\n\n\n<li>Potentiometer \u2013 1 X 10 Kohm, Pier Part # PT15NV02-103A2020-S or similar<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"CODESYS_Control_Win\"><\/span>CODESYS Control Win<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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 learning, is that you can practice the development of PLC applications without purchasing expensive and specialized hardware.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The soft PLC software selected for this training station is CODESYS Control Win. CODESYS is a provider of manufacturer-independent automation software, so it is not limited to PLCs provided by a single manufacturer. It is used by multiple PLC vendors. Festo, Eaton, ABB and Turk are just a few of the vendors with CODESYS compatible PLCs. The soft PLC can be programmed with software titled CODESYS Development System. The soft PLC and the development system both conform to IEC 61131-3. That is the industry standard for PLC programming languages. That means the training station will be suitable for practicing any standard PLC language, such as ladder diagram.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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\">The CODESYS Development System can be downloaded from the CODESYS website. The soft PLC, CODESYS Control Win, is included with the bundle that is downloaded with the development system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can learn more about CODESYS by visiting the website.&nbsp; <a href=\"https:\/\/www.codesys.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.codesys.com\/<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Arduino_UNO\"><\/span>Arduino UNO<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Arduino UNO board is a microcontroller board, designed for learning electronics, developed by Arduino.cc. The board has built in inputs and outputs (I\/O). There are 14 pins for digital I\/O that can be assigned as input or output. There is an analog to digital convertor that provide 6 analog inputs with 10 bit resolution.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The board can generate analog output signals using Pulse Width Modulation (PWM). PWM is a method of controlling a digital output\u2019s frequency and duty cycle to deliver the desired average voltage. PLCs normally rely on digital to analog converters for analog outputs, but the PWM method is suitable for our training station.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The board is programmable with software titled Arduino Integrated Development Environment (Arduino IDE). When programmed to do so, the Arduino Uno can communicate, as a slave device, with the soft PLC and connect it to real word inputs and outputs. This makes it ideal for our training station.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The version selected for our training station is Arduino UNO Rev3.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can learn more about Arduino by visiting the website. <a href=\"https:\/\/www.arduino.cc\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.arduino.cc\/<\/a><\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"482\" height=\"321\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-board.jpg\" alt=\"\" class=\"wp-image-273\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-board.jpg 482w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-board-300x200.jpg 300w\" sizes=\"auto, (max-width: 482px) 85vw, 482px\" \/><figcaption class=\"wp-element-caption\"><br><br><\/figcaption><\/figure>\n<\/div>\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install_CODESYS_On_Your_PC\"><\/span>Install CODESYS On Your PC<span class=\"ez-toc-section-end\"><\/span><\/h1>\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 <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<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Download\"><\/span>Download<span class=\"ez-toc-section-end\"><\/span><\/h2>\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\/\" target=\"_blank\" rel=\"noreferrer noopener\">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\/\" target=\"_blank\" rel=\"noreferrer noopener\">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\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"624\" height=\"125\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Codesys-signin-1.jpg\" alt=\"\" class=\"wp-image-275\" style=\"width:714px;height:143px\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Codesys-signin-1.jpg 624w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Codesys-signin-1-300x60.jpg 300w\" sizes=\"auto, (max-width: 624px) 85vw, 624px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">From the customer login screen, you have options:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"223\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/login-options-1024x223.jpg\" alt=\"\" class=\"wp-image-312\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/login-options-1024x223.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/login-options-300x65.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/login-options-768x167.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/login-options.jpg 1183w\" 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\">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\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"277\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Select-Download-1024x277.jpg\" alt=\"\" class=\"wp-image-313\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Select-Download-1024x277.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Select-Download-300x81.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Select-Download-768x208.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Select-Download.jpg 1178w\" 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<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Install\"><\/span>Install<span class=\"ez-toc-section-end\"><\/span><\/h2>\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<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"886\" height=\"427\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-codesys.jpg\" alt=\"\" class=\"wp-image-314\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-codesys.jpg 886w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-codesys-300x145.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-codesys-768x370.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 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\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"811\" height=\"557\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/install-complete.jpg\" alt=\"\" class=\"wp-image-315\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/install-complete.jpg 811w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/install-complete-300x206.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/install-complete-768x527.jpg 768w\" sizes=\"auto, (max-width: 811px) 85vw, 811px\" \/><\/figure>\n\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<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Arduino_Board_Software\"><\/span>Arduino Board Software<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Download_and_Install_Arduino_IDE_On_Your_PC\"><\/span>Download and Install Arduino IDE On Your PC<br><br><span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Download-2\"><\/span>Download<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Software is available from the Arduino website.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Got to <a href=\"https:\/\/www.arduino.cc\/en\/software\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.arduino.cc\/en\/software<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Select the Windows version of the IDE to download.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"590\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-download-1024x590.jpg\" alt=\"\" class=\"wp-image-317\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-download-1024x590.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-download-300x173.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-download-768x442.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-download.jpg 1156w\" 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\">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=\"Install-2\"><\/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\"><img loading=\"lazy\" decoding=\"async\" width=\"964\" height=\"662\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-install.jpg\" alt=\"\" class=\"wp-image-318\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-install.jpg 964w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-install-300x206.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-install-768x527.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 prompted to select components to install, it is recommended to install all components. The shortcuts and are optional, but useful.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"826\" height=\"570\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-components.jpg\" alt=\"\" class=\"wp-image-319\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-components.jpg 826w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-components-300x207.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-components-768x530.jpg 768w\" sizes=\"auto, (max-width: 826px) 85vw, 826px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Continue following the prompts to complete the installation.<br><br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Open_And_Setup_Arduino_IDE\"><\/span>Open And Setup Arduino IDE<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><br><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start the Arduino IDE on your PC:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td class=\"has-text-align-left\" data-align=\"left\">by double clicking the icon <br><img loading=\"lazy\" decoding=\"async\" width=\"200\" height=\"176\" class=\"wp-image-320\" style=\"width: 200px;\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-icon.jpg\" alt=\"\"><\/td><td>Or selecting from start menu <br><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"334\" class=\"wp-image-321\" style=\"width: 300px;\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-start-menu.jpg\" alt=\"\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-start-menu.jpg 411w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-start-menu-270x300.jpg 270w\" sizes=\"auto, (max-width: 300px) 85vw, 300px\" \/><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The Arduino IDE window will appear. From the Tools menu, select the board type Arduino Uno.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"583\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-board-type-1024x583.jpg\" alt=\"\" class=\"wp-image-328\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-board-type-1024x583.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-board-type-300x171.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-board-type-768x438.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/arduino-board-type.jpg 1176w\" 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\">Connect the microcontroller board to the PC with a USB cable. Set the COM port from the Tools menu. The COM port should match the port assigned in the Windows Device Manager. If you need to know how to check the COM port, see the guide <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 Manage<\/a><a href=\"#Check-Com-Port\">r<\/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<p class=\"wp-block-paragraph\">If the board is not connected to the PC it will not be visible from the Tools menu or the Device Manager.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"788\" height=\"578\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/set-com-port.jpg\" alt=\"\" class=\"wp-image-330\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/set-com-port.jpg 788w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/set-com-port-300x220.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/set-com-port-768x563.jpg 768w\" sizes=\"auto, (max-width: 788px) 85vw, 788px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The board type and COM port are displayed at the lower right of the window.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"749\" height=\"545\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-and-com-lower-right.jpg\" alt=\"\" class=\"wp-image-331\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-and-com-lower-right.jpg 749w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-and-com-lower-right-300x218.jpg 300w\" sizes=\"auto, (max-width: 749px) 85vw, 749px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Acquire_The_Slave_Device_Sketch_and_Load_It_To_The_Arduino_Board\"><\/span>Acquire The Slave Device Sketch and Load It To The Arduino Board<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The microcontroller board can be programed to perform many different tasks. Programs for Arduino are called \u201csketches\u201d. A sketch to set up the microcontroller board, as a slave device, already exists. It was designed and developed to work with OpenPLC devices. Open PLC is a fully open-source Programmable Logic Controller. The OpenPLC project is another great way to learn about PLCs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can learn more about OpenPLC from their website. <a href=\"https:\/\/www.openplcproject.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.openplc<\/a><a href=\"https:\/\/www.openplcproject.com\/\">pr<\/a><a href=\"https:\/\/www.openplcproject.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">ojec<\/a><a href=\"https:\/\/www.openplcproject.com\/\">t.com\/<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The sketch for the OpenPLC slave device, with a small adjustment, works just as well with the soft PLC, for our training station. The connection between the Soft PLC and the slave device uses a communication protocol called Modbus. It is the Modbus slave ID number that we will adjust in the sketch.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the sketch has been loaded to the board, it will become a slave device. The I\/O pinout is shown in the diagram titled <em>Slave Device I\/O<\/em>. Pins 2, 3, 4, 5 and 6 will be digital inputs. Pins 7,8, 12 and 13 will be digital outputs. Pins 9, 10 and 11 serve as analog outputs. Pins A0 through A5 are analog inputs.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"682\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/Slave-Device-IO-1024x682.jpg\" alt=\"\" class=\"wp-image-1354\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/Slave-Device-IO-1024x682.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/Slave-Device-IO-300x200.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/Slave-Device-IO-768x511.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/Slave-Device-IO-1536x1022.jpg 1536w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/Slave-Device-IO-100x67.jpg 100w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/Slave-Device-IO-150x100.jpg 150w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/Slave-Device-IO.jpg 1639w\" 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=\"Download_The_Sketch\"><\/span>Download The Sketch<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Click the link to download a copy of the sketch, modified for our training station, here.<\/p>\n\n\n\n<div class=\"wp-block-file\"><a id=\"wp-block-file--media-cd1d2f38-5f2a-4fee-b6e8-d4e8a3db9066\" href=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/OpenPLC_UnoCodesys-1.zip\">OpenPLC_UnoCodesys-1<\/a><a href=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2024\/01\/OpenPLC_UnoCodesys-1.zip\" class=\"wp-block-file__button wp-element-button\" download aria-describedby=\"wp-block-file--media-cd1d2f38-5f2a-4fee-b6e8-d4e8a3db9066\">Download<\/a><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">The download location will vary depending on your browser and your chosen setup. . From the file\u2019s download location or wherever you chose to move it, Unzip \/ Extract it to prepare for use.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"815\" height=\"444\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/unzip-arduino.jpg\" alt=\"\" class=\"wp-image-341\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/unzip-arduino.jpg 815w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/unzip-arduino-300x163.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/unzip-arduino-768x418.jpg 768w\" sizes=\"auto, (max-width: 815px) 85vw, 815px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_was_the_Sketch_Modified\"><\/span>How was the Sketch Modified?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"> \u201c\/\/ModBus Port information\u201d  changed the ID from 0 to 1. This is the Modbus address for the slave device.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"911\" height=\"566\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-IDE.jpg\" alt=\"\" class=\"wp-image-345\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-IDE.jpg 911w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-IDE-300x186.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Arduino-IDE-768x477.jpg 768w\" 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=\"Upload_to_Microcontroller_Board\"><\/span><strong>Upload to Microcontroller Board<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">From the extracted folder \u201cOpenPLC_Uno_v3\u201d find the file \u201cOpenPLC_UnoCodesys.zip\u201d. Double click to open the sketch with Arduino IDE.<\/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=\"597\" height=\"432\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-sketch.jpg\" alt=\"\" class=\"wp-image-342\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-sketch.jpg 597w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-sketch-300x217.jpg 300w\" sizes=\"auto, (max-width: 597px) 85vw, 597px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The window for the Arduino IDE will appear. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the board is connected to the PC with USB cable and the correct board type and COM port are selected. Transferring the file to the microcontroller board is referred to as Uploading by the Arduino IDE. From the Sketch menu select Upload.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"825\" height=\"514\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/upload-sketch.jpg\" alt=\"\" class=\"wp-image-347\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/upload-sketch.jpg 825w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/upload-sketch-300x187.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/upload-sketch-768x478.jpg 768w\" sizes=\"auto, (max-width: 825px) 85vw, 825px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">While in process, a message is displayed that will say \u201cCompiling Sketch\u201d or \u201cUploading\u201d.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"909\" height=\"226\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/sketch-uploading.jpg\" alt=\"\" class=\"wp-image-348\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/sketch-uploading.jpg 909w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/sketch-uploading-300x75.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/sketch-uploading-768x191.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 the transfer is complete. The message \u201cDone Uploading\u201d will appear.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"929\" height=\"229\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/sketch-done-uploading.jpg\" alt=\"\" class=\"wp-image-349\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/sketch-done-uploading.jpg 929w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/sketch-done-uploading-300x74.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/sketch-done-uploading-768x189.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\">At this point, you have completed the software tasks for the microcontroller board.<\/p>\n\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Wiring_The_Arduino_Board\"><\/span>Wiring The Arduino Board<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">The diagram titled <em>Microcontroller Schematic<\/em> shows how the training stand will be connected to real world I\/O through the slave device.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The digital inputs at pins 2, 3, 4, 5, and 6 are wired as sinking inputs. Each digital input has a NO push button that will switch on +5 volts when pressed. Each input also has a 10 Kohm, pull-down, resistor connected. This ensures that inputs go to 0 volts when the buttons are released. The microcontroller board inputs are sensitive to noise and false ON signals happen frequently without the pull-down resistors in place.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The digital outputs at pins 7, 8, 12 and 13 are wired as sourcing outputs. Every digital output has a coloured LED, Red, Yellow, Green or Blue that will light up when the output is on. There are 220 ohm, current limiting, resistors in series with each LED.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An analog output, at pin 9, is connected to a white LED with a current limiting resistor in series. The wiring is similar to the digital outputs. What is different is that the analog output will use PWM to control the brightness of the LED rather than just turning it on and off.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An analog input, A0, is connected to the wiper of a 10 Kohm potentiometer. Based on it\u2019s adjustment, the potentiometer can provide a voltage of 0 VDC to +5 VDC.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A proposed plan for the breadboard is shown in the diagram titled <em>Suggested Board Layout<\/em>. To the left shows a breadboard with the basic components in place. To the right is the breadboard with wiring completed, with the microcontroller board and the wire jumpers in place. Of course, you may chose to wire the breadboard in your own way.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"689\" height=\"1024\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/microcontroller-schematic-689x1024.jpg\" alt=\"\" class=\"wp-image-350\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/microcontroller-schematic-689x1024.jpg 689w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/microcontroller-schematic-202x300.jpg 202w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/microcontroller-schematic-768x1142.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/microcontroller-schematic-1033x1536.jpg 1033w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/microcontroller-schematic.jpg 1216w\" sizes=\"auto, (max-width: 689px) 85vw, 689px\" \/><\/figure>\n<\/div>\n\n<div class=\"wp-block-image is-resized is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"798\" height=\"1024\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-layout-798x1024.jpg\" alt=\"\" class=\"wp-image-355\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-layout-798x1024.jpg 798w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-layout-234x300.jpg 234w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-layout-768x985.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-layout-1198x1536.jpg 1198w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-layout-1597x2048.jpg 1597w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/board-layout-scaled.jpg 1996w\" sizes=\"auto, (max-width: 798px) 85vw, 798px\" \/><\/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=\"868\" height=\"564\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Finished-product.jpg\" alt=\"\" class=\"wp-image-358\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Finished-product.jpg 868w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Finished-product-300x195.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Finished-product-768x499.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Setup_The_Soft_PLC_For_Slave_Device\"><\/span>Setup The Soft PLC For Slave Device<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_New_Project\"><\/span>Create New Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Start the CODESYS Development System:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>by double clicking the icon<br><img loading=\"lazy\" decoding=\"async\" width=\"200\" height=\"224\" class=\"wp-image-360\" style=\"width: 200px;\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/codesys-icon.jpg\" alt=\"\"><\/td><td>Or selecting from start menu<br><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"321\" class=\"wp-image-361\" style=\"width: 300px;\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/codesys-start-menu.jpg\" alt=\"\"><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Select New Project from the Start Page.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"649\" height=\"436\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/new-project.jpg\" alt=\"\" class=\"wp-image-362\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/new-project.jpg 649w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/new-project-300x202.jpg 300w\" sizes=\"auto, (max-width: 649px) 85vw, 649px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">From the New Project dialog box, select Standard Project. &nbsp;This project will be our Base project that we will use for our training station. So, a good name would be \u201cTraining Station Base\u201d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the selections have been made, 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=\"852\" height=\"519\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/standard-project.jpg\" alt=\"\" class=\"wp-image-363\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/standard-project.jpg 852w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/standard-project-300x183.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/standard-project-768x468.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\">Select 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=\"http:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/#Check-what-version\">Check W<\/a><a href=\"#Check-what-version\">ha<\/a><a href=\"http:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/#Check-what-version\" target=\"_blank\" rel=\"noreferrer noopener\">t Version O<\/a><a href=\"#Check-what-version\">f CODESYS Control Win Soft PLC Is Installed<\/a><\/em> in the <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/\" data-type=\"URL\" data-id=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/\" target=\"_blank\" rel=\"noreferrer noopener\">Help Section<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Our purpose for setting up the training station is to learn ladder logic. So, select Ladder Logic Diagram for PLC_PRG.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once the selections have been made, click OK. The new project will be created.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"596\" height=\"366\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/32-bit-device.jpg\" alt=\"\" class=\"wp-image-398\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/32-bit-device.jpg 596w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/32-bit-device-300x184.jpg 300w\" sizes=\"auto, (max-width: 596px) 85vw, 596px\" \/><\/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=\"596\" height=\"366\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/64-bit-device.jpg\" alt=\"\" class=\"wp-image-399\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/64-bit-device.jpg 596w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/64-bit-device-300x184.jpg 300w\" sizes=\"auto, (max-width: 596px) 85vw, 596px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Add_Slave_Device_Modbus_Config_To_Project\"><\/span>Add Slave Device Modbus Config To Project<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Right click the Device object and select Add Device.<\/p>\n\n\n<div class=\"wp-block-image 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. Under the heading Modbus, double click Modbus COM to add the device. Then click on the X symbol at the upper right of the Add Device dialog box to close.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><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<\/div>\n\n\n<p class=\"wp-block-paragraph\">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. The COM port parameter should match the port assigned to the microcontroller board. If you do not recall the port number, you can check the device manager. The method to check the device manger in the <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/\" data-type=\"URL\" data-id=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/\" target=\"_blank\" rel=\"noreferrer noopener\">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<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"460\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device2-1024x460.jpg\" alt=\"\" class=\"wp-image-402\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device2-1024x460.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device2-300x135.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device2-768x345.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Add-modbus-device2.jpg 1180w\" 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\">Right click the Modbus_COM object and select Add Device.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><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<\/div>\n\n\n<p class=\"wp-block-paragraph\">Under the heading Modbus Serial Master double click Modbus Master, Com Port to add the device. Then click on the X symbol at the upper right of the Add Device dialog box to close.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><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<\/div>\n\n\n<p class=\"wp-block-paragraph\">Right click the Modbus_Master_COM_Port object and select Add Device.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><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<\/div>\n\n\n<p class=\"wp-block-paragraph\">Under the heading Modbus Serial Slave double click Modbus Slave, Com Port to add the device. Then click on the X symbol at the upper right of the Add Device dialog box to close.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><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<\/div>\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-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\">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\">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\">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\">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<h1 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Testing_The_PLC_Training_Station\"><\/span>Testing The PLC Training Station<span class=\"ez-toc-section-end\"><\/span><\/h1>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Communication_Settings_Connection_Path_To_PLC\"><\/span>Communication Settings Connection Path To PLC<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Since this is the first time connecting with a new project, on a fresh install of the soft PLC, steps need to be taken to define the connection path to the PLC and setup the PLC login.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To work online with the soft PLC, both the gateway and PLC must both be running. To see how to check the status and start \/ stop the services, check in the <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/\" target=\"_blank\" rel=\"noreferrer noopener\">Help Section<\/a>. The guide is titled <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/#Start-stop-codesys\" target=\"_blank\" rel=\"noreferrer noopener\"><em>Start Or Stop CODESYS Control Win Soft PLC And Gateway<\/em>.<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To proceed, open the project for the training station. Double click the Device object to open the editor. The Communication Settings tab should be selected. A graphic image of the PLC network is displayed. The image shows icons for the PC to the left, the gateway to the middle and the PLC to the right. The gateway and the PLC icons both have a round dot status indicator at the lower right. When the dot is green it means the device is connected.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To define the connection path, select the Scan Network tab at the top of the window.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"556\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Scan-network-1024x556.jpg\" alt=\"\" class=\"wp-image-413\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Scan-network-1024x556.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Scan-network-300x163.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Scan-network-768x417.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Scan-network.jpg 1246w\" 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 scan will detect any devices connected to the gateway. A dialog box titled Select Device will appear, showing devices found under the gateway heading. The soft PLC should appear here. Since it is installed on your PC, the name will match device name of your PC. If you unsure what the device name is for your PC, 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<p class=\"wp-block-paragraph\">Select the desired device and then click OK to accept the change.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"972\" height=\"622\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Select-desired-device.jpg\" alt=\"\" class=\"wp-image-415\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Select-desired-device.jpg 972w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Select-desired-device-300x192.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Select-desired-device-768x491.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\">A message will appear asking if you wish to activate user management. This will prompt you to create an administrator account to access the PLC. You must select Yes to proceed.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"408\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/prompt-user-managment.jpg\" alt=\"\" class=\"wp-image-416\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/prompt-user-managment.jpg 583w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/prompt-user-managment-300x210.jpg 300w\" sizes=\"auto, (max-width: 583px) 85vw, 583px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The add device user dialog box will appear. Enter a user name and password to for the new account. Remember the user name and password to access the PLC in the future. Click OK to create the account.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"583\" height=\"316\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-device-user-dialog.jpg\" alt=\"\" class=\"wp-image-417\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-device-user-dialog.jpg 583w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-device-user-dialog-300x163.jpg 300w\" sizes=\"auto, (max-width: 583px) 85vw, 583px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">Next you will be prompted to provide a user name and password to connect to the PLC. Enter the user name and password from the account you just created. Then 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=\"601\" height=\"294\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/user-mname-and-password.jpg\" alt=\"\" class=\"wp-image-418\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/user-mname-and-password.jpg 601w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/user-mname-and-password-300x147.jpg 300w\" sizes=\"auto, (max-width: 601px) 85vw, 601px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The image of the PLC network should show green status for both the gateway and the PLC.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"504\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-network-green-status-1024x504.jpg\" alt=\"\" class=\"wp-image-419\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-network-green-status-1024x504.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-network-green-status-300x148.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-network-green-status-768x378.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/PLC-network-green-status.jpg 1099w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Connecting_To_PLC_Online_And_Download\"><\/span>Connecting To PLC Online And Download<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before going online, make sure the slave device (microcontroller board) is connected to the PC with a USB cable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Connecting or disconnecting the CODESYS Development System and PLC is accomplished by the Login and Logout commands, available from the Online menu. To work online with the PLC, select the Login 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=\"966\" height=\"713\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Login-command.jpg\" alt=\"\" class=\"wp-image-420\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Login-command.jpg 966w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Login-command-300x221.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Login-command-768x567.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\">Since there is no application loaded to the PLC, you will be prompted to transfer to the PLC. Transferring files to the PLC is referred to as Downloading. Select Yes to download the application to the PLC.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"853\" height=\"337\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/prompt-to-download.jpg\" alt=\"\" class=\"wp-image-421\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/prompt-to-download.jpg 853w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/prompt-to-download-300x119.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/prompt-to-download-768x303.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 device and application objects will be highlighted in green, indicating the PLC is online. In parenthesis the device indicates it is connected, the application indicates it is stopped.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"761\" height=\"474\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Devcie-tree-status.jpg\" alt=\"\" class=\"wp-image-422\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Devcie-tree-status.jpg 761w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Devcie-tree-status-300x187.jpg 300w\" sizes=\"auto, (max-width: 761px) 85vw, 761px\" \/><\/figure>\n<\/div>\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Starting_The_Application_And_Testing_Modbus\"><\/span>Starting The Application And Testing Modbus<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Starting and stopping the application is accomplished with the Start and Stop commands available from the Debug menu. To start the application, select the Start 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=\"1012\" height=\"470\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/start-command.jpg\" alt=\"\" class=\"wp-image-423\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/start-command.jpg 1012w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/start-command-300x139.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/start-command-768x357.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\">Green arrows that form a circle, are indicators that the slave device communication is working. Blinking yellow TX and RX LEDs on the board, indicate communication is working on that end as well. If communication is not working at this point, see the guide <em><a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/#slave-device-coms\" target=\"_blank\" rel=\"noreferrer noopener\">Slave Device Communication Troubleshooting<\/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<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"387\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/slave-devcie-com-status-1024x387.jpg\" alt=\"\" class=\"wp-image-424\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/slave-devcie-com-status-1024x387.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/slave-devcie-com-status-300x113.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/slave-devcie-com-status-768x290.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/slave-devcie-com-status.jpg 1108w\" 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\">If communication between the slave device and PLC are working, it is a good time to save your project. To prepare for the next step, stop the application and logout to disconnect from the PLC.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"IO_Test\"><\/span>I\/O Test<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">It is important to test the real world I\/O connected to the training station. It can really complicate our efforts to learn programming if the hardware is not working. When you continue the learning series, Exercises 4 through 9 will take you step by step through the process of writing a Ladder program designed to test the digital I\/O. Then describe how to perform the test. Later in the series there will be a test for the analog I\/O. So, if you want to wait until then that is OK and you can consider the training station setup complete for now. But, if you are eager to see this thing in action, then complete these last few steps.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We will create a separate project with programing to put the inputs and outputs through a test run. The code for the program is provided. It is in Structured Text (ST) format to make it easy to cut and paste. The test is a simple one, as each of the push buttons is pressed an assigned LED, red, yellow, green or blue should light. Then, when the potentiometer, connected to an analog input, is adjusted it should control the brightness of the white LED.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create_Test_Project\"><\/span>Create Test Project<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">We will create the new project for this exercise using a copy of the base project that was already setup. This way the new project already has the communication config for the slave device.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure you have <strong>saved the project<\/strong> \u201cTraining Station Base\u201d.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With the project \u201cTraining Station Base\u201d open, from the File menu select Save Project As.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Save with new name \u201cIO Test\u201d to create the test 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=\"1025\" height=\"500\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-as-IO-test.jpg\" alt=\"\" class=\"wp-image-427\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-as-IO-test.jpg 1025w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-as-IO-test-300x146.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/save-as-IO-test-768x375.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\">To create a new program for the test logic, right click the Application object, select Add Object and then select POU.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"845\" height=\"532\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/create-new-program.jpg\" alt=\"\" class=\"wp-image-428\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/create-new-program.jpg 845w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/create-new-program-300x189.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/create-new-program-768x484.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 name for the new POU will be IO_Test. It will be a program type and the language will be structured text. Select Add to create the new program.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"439\" height=\"612\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-POU.jpg\" alt=\"\" class=\"wp-image-429\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-POU.jpg 439w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/add-POU-215x300.jpg 215w\" sizes=\"auto, (max-width: 439px) 85vw, 439px\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">The new program IO_Test should appear in the window to the left. The editor for the program should be open and visible in the middle of the screen with the program name in the tab above. If the editor is not open, double click the object for the program IO_Test to open the editor.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"988\" height=\"553\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-editor-IO-test.jpg\" alt=\"\" class=\"wp-image-430\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-editor-IO-test.jpg 988w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-editor-IO-test-300x168.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/open-editor-IO-test-768x430.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 text is the rectangle below is the code, in structured text format, that is to be copied to the program IO_Test. This is not intended to be a lesson on structured text. Using the ST language is simply the easiest way to copy text from this document into our test program.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>\/\/Start Here<br>\/\/ IO Test Program for training station<br>\/\/ Cut and Paste to Structured Text POU<br>&nbsp;<br>\/\/ PB 1 @ input0(Pin2) and PB5 @ input4(Pin6) light Red LED @ output0(Pin7)<br>%QX0.0 := %IX0.0 OR %IX0.4;<br>&nbsp;<br>\/\/ PB 2 @ input1(Pin3) light Yellow LED @ output1(Pin8)<br>%QX0.1 := %IX0.1;<br>&nbsp;<br>\/\/ PB 3 @ input2(Pin4) light Green LED @ output2(Pin12)<br>%QX0.2 := %IX0.2;<br>&nbsp;<br>\/\/ PB 4 @ input3(Pin5) light blue LED @ output3(Pin13)<br>%QX0.3 := %IX0.3;<br>&nbsp;<br>\/\/ Pot @ A0 controls brightness of white LED @ Pin9<br>%QW1 := %IW1;<br>\/\/End Here<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Place the mouse cursor at the beginning of the blue text (\/\/Start Here), click to select and highlight until the end of the blue text (\/\/End Here) and copy. Then paste to the editor for IO_Test<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"497\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/copy-paste-text-1024x497.jpg\" alt=\"\" class=\"wp-image-435\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/copy-paste-text-1024x497.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/copy-paste-text-300x146.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/copy-paste-text-768x373.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/copy-paste-text.jpg 1045w\" 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 code should appear in the editor window.<\/p>\n\n\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"584\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Code-in-editor-windpw-1024x584.jpg\" alt=\"\" class=\"wp-image-437\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Code-in-editor-windpw-1024x584.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Code-in-editor-windpw-300x171.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Code-in-editor-windpw-768x438.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Code-in-editor-windpw.jpg 1033w\" 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\">A quick and easy way to set up the program to execute as part of the main task is to copy the program from under the heading Application and paste to the heading MainTask.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the program IO_Test is included under the heading MainTask it is time to save 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=\"521\" height=\"558\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Copy-paste-IO-Test.jpg\" alt=\"\" class=\"wp-image-438\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Copy-paste-IO-Test.jpg 521w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/Copy-paste-IO-Test-280x300.jpg 280w\" sizes=\"auto, (max-width: 521px) 85vw, 521px\" \/><\/figure>\n<\/div>\n\n\n<h3 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Connect_And_Download_Test_Project\"><\/span>Connect And Download Test Project<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Before going online, make sure the slave device (microcontroller board) is connected to the PC with a USB cable.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Make sure the soft PLC and gateway are running. (see <em><a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/#Start-stop-codesys\">Start Or Stop CODESYS Control Win Soft PLC And Gateway<\/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\">With the project \u201cIO_Test\u201d opened, use the Login command to connect to the PLC. Enter the username and password if prompted. When prompted to download the application, select Yes.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use the Start command to start the application. Then, determine modbus communication is OK by checking the RX \/ TX LEDs on the slave device or the circular green arrows beside the modbus objects in the left hand window. If communication is not working at this point, see the guide <em><a rel=\"noreferrer noopener\" href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/help-section\/#slave-device-coms\" target=\"_blank\">Slave Device Communication Troubleshooting<\/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\">Connected and running, it should look like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"562\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/connected-should-look-like-this-1024x562.jpg\" alt=\"\" class=\"wp-image-439\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/connected-should-look-like-this-1024x562.jpg 1024w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/connected-should-look-like-this-300x165.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/connected-should-look-like-this-768x421.jpg 768w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/connected-should-look-like-this.jpg 1026w\" 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=\"IO_Checklist\"><\/span>I\/O Checklist<span class=\"ez-toc-section-end\"><\/span><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">To test the inputs and outputs, use the I\/O checklist below. Press each of the buttons and adjust the potentiometer. Check for the appropriate output action. If the input and output actions match the list, put a check mark in the row for the input \/ output pair.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-style-default\"><img loading=\"lazy\" decoding=\"async\" width=\"872\" height=\"551\" src=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/IO-Checklist.jpg\" alt=\"\" class=\"wp-image-440\" srcset=\"https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/IO-Checklist.jpg 872w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/IO-Checklist-300x190.jpg 300w, https:\/\/mitechservices.ca\/MITS\/wp-content\/uploads\/2022\/04\/IO-Checklist-768x485.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\">At this point you have completed the PLC training stand setup and testing. You are ready to advance to learning PLC programming.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This section is all about how to setup a PLC trainer with CODESYS and Arduino. Overview The intent of this documentation is to provide instructions to set up a PLC training station that can be used to practice PLC programming. When we learn the basics of PLCs, we discover 3 main components are the CPU &hellip; <a href=\"https:\/\/mitechservices.ca\/MITS\/mi-learning-plc-fundamentals\/diy-plc-training-station\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;DIY PLC Training Station&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":73,"menu_order":9,"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-270","page","type-page","status-publish","hentry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/pages\/270","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=270"}],"version-history":[{"count":61,"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/pages\/270\/revisions"}],"predecessor-version":[{"id":1361,"href":"https:\/\/mitechservices.ca\/MITS\/wp-json\/wp\/v2\/pages\/270\/revisions\/1361"}],"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=270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}