<p>Hands-On Lab Workbook</p><p>Basics of PLCs Basics of PLCs: Hands-On Lab</p><p>Training Lab Manual ABOUT THIS HANDS-ON LAB ______7</p><p>BEFORE YOU BEGIN______7</p><p>LAB MATERIALS______8</p><p>DOCUMENT CONVENTIONS______9</p><p>LAB 1: CONFIGURING THE COMPUTER TO COMMUNICATE TO THE PLC______11</p><p>LAUNCHING RSLINX COMMUNICATION SOFTWARE AND CONFIGURING A DRIVER______11</p><p>LAB 2: CREATING A NEW PROJECT______14</p><p>ABOUT THIS LAB______14</p><p>ABOUT MICROLOGIX CONTROLLERS______14</p><p>LAUNCHING RSLOGIX 500 PROGRAMMING SOFTWARE______15</p><p>CREATING A NEW CONTROLLER PROJECT______15</p><p>EXAMINING YOUR NEW RSLOGIX 500 PROJECT______18</p><p>ASSIGNING I/O MODULES______19</p><p>CREATING THE FIRST RUNG OF LADDER LOGIC______21</p><p>CREATING THE SECOND LADDER LOGIC RUNG______25</p><p>CREATING THE THIRD LADDER LOGIC RUNG______30</p><p>VERIFYING YOUR LADDER LOGIC PROGRAM______31</p><p>SAVING YOUR WORK______32</p><p>LAB3: TESTING YOUR LADDER LOGIC______33</p><p>DOWNLOADING YOUR LADDER LOGIC TO THE PLC______33</p><p>CHANGING THE PLC FROM PROGRAM TO RUN MODE______35</p><p>MONITORING AND TESTING YOUR PLC LADDER PROGRAM______36</p><p>LAB 4: USING BASIC INSTRUCTIONS IN LADDER LOGIC______38</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 3 of 48 GOING OFF-LINE WITH THE PLC______38</p><p>COPY AND RENAME YOUR PREVIOUS LADDER LOGIC PROGRAM______38</p><p>MODIFYING YOUR EXISTING LADDER LOGIC PROGRAM______39</p><p>ADDING A TIMER TO YOUR LADDER LOGIC PROGRAM______40</p><p>ADDING A COUNTER TO YOUR LADDER LOGIC PROGRAM______41</p><p>ADDING A LIMIT INSTRUCTION TO YOUR LADDER LOGIC PROGRAM______42</p><p>VERIFYING YOUR LADDER LOGIC PROGRAM______43</p><p>ADDING RUNG COMMENTS TO YOUR LADDER LOGIC PROGRAM______45</p><p>SAVING YOUR WORK______46</p><p>DOWNLOADING THE LADDER LOGIC PROGRAM TO THE PLC______47</p><p>MONITORING AND TESTING YOUR LADDER LOGIC PROGRAM______49</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 4 of 48 Welcome to the Basics of PLCs Hands-On Lab</p><p>About This Hands-On Lab</p><p>This session provides you with an opportunity to explore the basics of programmable logic control using a MicroLogix 1200, or MicroLogix 1500 PLC, depending on the station at which you find yourself seated. The following sections explain what you’ll be doing in this lab session, and what you will need to do to complete the hands-on exercises. What You Will Accomplish In This Lab As you complete the exercises in this hands-on session, you will: . develop an understanding of the concepts of PLC’s and an introduction to basic programming . design, create and download programs to a MicroLogix controller . examine the PLC executing a program Who Should Complete This Lab This hands-on lab is intended for individuals who: . have little or no experience with PLC’s and want to learn the basics of how PLC’s operate . are interested in becoming familiar with the basics of programming a PLC using ladder logic . are interested in becoming familiar with RSLogix 500 programming software Pre-Requisites For This Lab . General understanding of electrical control . Basics of Microsoft Windows 95/98/NT/2000/XP based computer</p><p>Before You Begin</p><p>Before you begin this Hands-On Lab, please be sure to close any applications that are currently running. </p><p>For this lab you will need to complete all sections in order, because each section builds upon the previous section.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 5 of 48 Lab Materials</p><p>For this Hands-On lab, we have provided you with the following materials that will allow you to complete the labs in this workbook. Hardware Your lab station will consist of one of the following: MicroLogix 1200: . (1) 1762-24BXB MicroLogix 1200 (14 DC Inputs / 10 DC/relay outputs, 24VDC power) . (1) 1762-IF2OF2 1762 Input/Output Analog Expansion Module . (1) 1794-PS1 24VDC Power Supply . (1) 1796-SIM1200 Input Simulator . (1) 1761-CBL-PM02 Serial cable (9-pin female to 8-pin mini-din) . (1) 1791D-8B8P Compact Block I/O - 8 Inputs/8 Outputs (Not used in this lab) MicroLogix 1500: . (1) 1764-L28BXB MicroLogix 1500 . (1) 1764-LRP Dual serial port MicroLogix 1500 processor . (1) 1764-DAT Data Access Terminal . (1) 1764-SIM1500 Input Simulator . (1) 1769-IQ6X0W4/A 24V DC Sink/Source Input, AC/DC Relay Output (Not used in this lab) . (1) 1769-IF4XOF2 4 Channel Current/Voltage Analog Input (Not used in this lab) . (1) 1769-SDN DeviceNet Scanner module (Not used in this lab) . (1) 1769-PA2 Power supply . (1) 1769-ECR Right end cap . (1) 1761-CBL-PM02 Serial cable (9-pin female to 8-pin mini-din) Software This hands-on lab uses the following software: . RSLogix 500 programming software . RSLinx Files No pre-configured files are required for this lab.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 6 of 48 Document Conventions</p><p>Throughout this workbook, we have used the following conventions to help guide you through the lab materials. This style or symbol: Indicates: Words shown in bold italics (e.g., Any item or button that you must click on, or a menu name from RSLogix 500 or OK) which you must choose an option or command. This will be an actual name of an item that you see on your screen or in an example. Words shown in Courier text, An item that you must type in the specified field. This is information enclosed in single quotes (e.g., that you must supply based on your application (e.g., a variable). 'Controller1') Note: When you type the text in the field, remember that you do not need to type the quotes; simply type the words that are contained within them (e.g., Controller1).</p><p>FYI The text that is displayed as shown is supplemental information regarding the lab materials; it is not information that is required reading in order for you to complete the lab exercises but may provide you with helpful hints that can make it easier for you to use this product.</p><p>Note: If the mouse button is not specified in the text, you should click on the left mouse button.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 7 of 48 Lab 1: Configuring the Computer to Communicate to the PLC</p><p>In this lab, we will introduce you to the RSLinx communications software. In this lab you will: . Start RSLinx . Auto-Configure an RSLinx RS-232 driver Launching RSLinx Communication Software and Configuring a Driver</p><p>RSLinx is the communication software that allows a PLC to communicate with your computer running RSLogix 500 software. We must first configure how we want our computer to communicate with our PLC.</p><p>1. From the Windows start menu select Start > Programs > Rockwell Software > RSLinx > RSLinx.</p><p>2. Once RSLinx starts, from the toolbar menu select Communications > Configure Drivers as shown below:</p><p>3. When the Configure Drivers window appears, from the Available Driver Types pull-down menu, choose the first one on the list which is RS-232 DF1 and then click the Add New button.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 8 of 48 4. When the following screen appears, click on OK to accept the default name.</p><p>This will launch the configuration screen for communications. There is a lot of information here, and this can appear confusing, however a great feature of RSLinx is that it can automatically configure all parameters for you (assuming that you are already connected to your controller). </p><p>5. Simply click on the AutoConfig button.</p><p>6. Verify that your Auto Configuration was successful as shown below:</p><p>This indicates that RSLinx has successfully tested and verified your communications. If Auto- Configure is not successful, verify that the communications cable from your computer (PC) is properly connected to your PLC and try the Auto-Configure again.</p><p>7. Click OK to close the Driver Configuration window. 8. Click Close to close the Configure Drivers window.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 9 of 48 We have completed configuring our communications driver and will not have to do this again on this computer. 9. Minimize (but do not close) RSLinx by clicking on the in the upper right corner of the RSLinx window.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 10 of 48 Lab 2: Creating a New Project </p><p>About This Lab</p><p>In this lab, we will introduce you to the basics of programming a PLC using controllers from the MicroLogix product family. In this lab you will: . Create a new project . Write 3 rungs of ladder logic to start and stop a simulated motor . Save your project to the hard drive of the PC . Download this project to the MicroLogix controller at your lab station . Monitor and Test your program on-line with the MicroLogix controller About MicroLogix Controllers</p><p>MicroLogix Based on the architecture of the market-leading SLC 500 controller family, the MicroLogix family of programmable controllers provides 3 levels of control. Small on size, big on performance, the MicroLogix 1000 offers control capabilities in an affordable, compact package. The MicroLogix 1200 is small enough to fit in tight spaces, but powerful enough to accommodate a broad range of applications. Designed to grow as your needs grow, the MicroLogix 1500 helps you achieve high- level control in a variety of applications. These small controllers bring high speed, powerful instructions and flexible communications to applications that demand compact, cost-effective solutions.</p><p>MicroLogix controllers are utilized in a very wide range of applications, from small high-speed stand alone controllers for local control, to network integrated clusters of controllers providing system- level solutions, and even remote terminal units that combine local control and data collection with master controllers that oversee complex architectures. These small controllers pack in a lot of high end features, such as: . Fast processing speed, with typical program scan of 1 to 3 msec per 1K User Program . Embedded high-speed inputs and outputs for: o High-speed counters for fast material handling applications o Latching & pulse catch inputs to detect transient pulses independent of program scan o I/O interrupts for real-time event processing o High-speed PTO (pulse train outputs) or PWM (pulse width modulated outputs) for low cost stepper or servo motor control, and heater element control o Adjustable filters to balance speed and environmental noise immunity . Expansion I/O (available on the MicroLogix 1200 and MicroLogix 1500 only) o Allows a controller to initially expand, and adapt over time o Provides the flexibility to mix different I/O types to match the needs of the application o Allows the controller to address I/O modules located remotely from the controller . Multiple protocol options to integrate into existing control environments or to establish efficient controller to controller or system wide communication networks</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 11 of 48 . World-class programming software: RSLogix 500 o And ease of use features such as the Hand-held programmer (MicroLogix 1000 only), trim pots (MicroLogix 1200 and 1500 only), remove and insert under power memory modules (MicroLogix 1200 and 1500 only), and the Data Access Tool (MicroLogix 1500 only).</p><p>Launching RSLogix 500 Programming Software</p><p>In this section of the lab, you will launch the RSLogix 500 software, which will allow you to program your MicroLogix controller.</p><p>1. From the Windows start menu, select Start > Programs > Rockwell Software > RSLogix 500 English > RSLogix 500 English as shown below:</p><p>Creating a New Controller Project</p><p>In this portion of the lab, you will create an offline program for your MicroLogix controller.</p><p>1. Identify which MicroLogix controller is at your lab station by examining the front of the controller (you will see either the MicroLogix 1200, or MicroLogix 1500).</p><p>2. Maximize RSLogix 500 by clicking the maximize Icon in the upper right hand corner of the RSLogix 500 window.</p><p>3. From the toolbar menu, select File > New to create a new controller file.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 12 of 48 4. Enter the Processor Name as ‘M-LAB1’ as shown below.</p><p>5. Using the down arrow, select the MicroLogix controller found at your lab workstation. If your lab station has a MicroLogix 1200 select as shown below:</p><p>If your lab station has a MicroLogix 1500 select as shown below:</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 13 of 48 6. Once you have selected your controller click OK.</p><p>7. From the toolbar menu, select File > Save As and enter ‘M-Lab1’ in the File name box and then click Save as shown below.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 14 of 48 8. If the following prompt appears, click Yes to replace the file.</p><p>Examining Your New RSLogix 500 Project</p><p>In this section of the lab, you will use the following display to review the RSLogix 500 programming environment. </p><p>A: Project Viewer . Controller information/setup = Series Revision, Configuration Information . Program Files - Where ladder logic is entered . Data Files - Where data values are stored . Force Files - Where you can override the state of the I/O with a “forced” value, so an input that is turned on by an external sensor may be forced off even when the sensor is turned on. Or a relay output may be forced on, even when the program running in the controller did not turn it on. . Custom Data Monitors = User Configurable Data monitor registers, which allows a user to manipulate user program information (beyond the scope of this course) B: Program Viewer . Where Programs reside . Where ladder logic is entered C: Program “TABS” . When a program file is open a “TAB” is created</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 15 of 48 . Allows easy/quick access to program file content D: Instruction Buttons . Drag & Drop, or Double Click . Must have “Program Viewer” Active E: Tabbed Toolbar . Instructions grouped by function. . Floating Toolbar Support</p><p>Assigning I/O modules</p><p>Before we can start writing our first ladder logic program we must first tell the software all the modules that are connected to the controller. You could do this manually and add each module separately, but RSLogix 500 software allows us to perform a “Read I/O configuration” and automatically configures our I/O saving us time identifying and manually adding each module.</p><p>We will not actually be using any expansion I/O modules in this lab however we still must properly configure our controllers for the actual hardware we have. </p><p>1. From the project tree, double-click on the I/O Configuration. This will open the I/O configuration screen.</p><p>2. When the I/O Configuration window appears, click on Read IO Config. This will cause the RSLogix 500 software to request information on the I/O modules connected to the controller.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 16 of 48 Note: The expansion I/O screen shown above is for the MicroLogix 1500 lab station. Depending on the type of controller at your lab station the I/O configuration window will appear differently since different controllers will use different expansion I/O modules. </p><p>3. Select the AB_DF1-1 driver as shown below and then click Read IO Config.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 17 of 48 The Read IO window will disappear and one of the following updated I/O configuration windows will appear as shown below for the appropriate hardware found at your lab station. MicroLogix 1200</p><p>MicroLogix 1500</p><p>4. After you have finished viewing the I/O configuration window click on the ‘x’ in the upper right corner of the window to close.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 18 of 48 Creating the First Rung of Ladder Logic</p><p>1. Verify that the ladder editor in RSLogix 500 is active by clicking in the white space below: </p><p>2. Click on the User tab.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 19 of 48 3. Locate the New Rung button.</p><p>4. Click and hold the New Rung with the left mouse button and drag the icon to rung zero (0000).</p><p>5. When you see the green X on rung zero release the left mouse button. </p><p>Rungs can be thought of as the means to get “current” from the left rail to the right rail. In simple relay ladder diagrams, wires did exactly that.</p><p>5. Verify that your RSLogix 500 program window should now appear as shown below.</p><p>The lower case ‘e’ to the left of the ladder logic indicates that the rung is in edit mode.</p><p>Our empty rung represents a “dead short”, so we need to add the conditions that define when we want “current to flow”, or actions to take place. We will start by adding an input instruction to our blank ladder rung. An input instruction gives the controller information that it interprets as the “cause” component of “cause and effect”. Given the proper inputs (“causes”) the controller will generate specific outputs (“effects”). </p><p>6. Click on the Bit tab to show the bit level instructions. </p><p>7. Click on the XIC instruction and again drag the instruction to your new rung. </p><p>8. When you see the green X, release the mouse button. The XIC instruction eXamines if an Input is Closed (a.k.a. a normally open contact).</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 20 of 48 We now need to provide an address for our new XIC input. The address tells the ladder logic where to look for the input. PLCs use addressing where Relay Logic (or hard-wired logic) used the physical connection of wires to make a circuit. </p><p>9. Make sure the instruction is highlighted and type ‘I:0/0’ and press Enter.</p><p>10. When the description window appears, enter the description as shown below and click on OK.</p><p>Adding a description is not required; however, it is good practice for program documentation and for future troubleshooting. This will allow you to later “read” your program, and understand it much more easily. </p><p>11. Verify that your ladder rung appears as follows:</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 21 of 48 Now let us add an output instruction to this rung. This represents the “effect”, as discussed earlier. </p><p>12. From the Bit tab, click and drag an OutpuT Energize OTE instruction to the rung as shown below. As before, when you see the green X release the mouse button. </p><p>Again we need to provide an address for our new OTE output. </p><p>13. Make sure the instruction is highlighted and type ’O:0/0’ and press Enter. Note: There is a difference between the letter “O” (which stands for Output), and the number “0”.</p><p>14. Enter a description as shown below and then click on OK.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 22 of 48 15. Verify that your ladder rung appears as follows: </p><p>If your addresses do not look the same, make sure that you are properly using the letter “O” and the number “0”. Congratulations you have just created your first rung of ladder logic! When the conditions on the input (left) side of a rung are met, the instruction on the output (right) side of the rung will be executed. In this case, the OTE instruction will be executed whenever the XIC instruction is evaluated as “true”. In other words, when the input (Input Switch 0) is closed or turned on at address I:0/0 the result will be the output (Output 0 on the controller) will be turned on at address O:0/0. </p><p>The inputs and outputs in your ladder logic can be physical, real outputs like the relay output shown above, or can be virtual or a bit stored in the data table. You use physical outputs for controlling external devices but you may want to create virtual outputs to identify when something turns on or off for others parts of your ladder logic program.</p><p>Creating the second ladder logic rung</p><p>We need to start a new rung. So let’s insert a new rung into our program. You can do this either by the method we used in the previous section (Click/Drag) or you can try another method: </p><p>1. Select rung 1 (0001) and simply press the Insert key on your keyboard. You will now see a new empty rung in your ladder logic program as shown below.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 23 of 48 Let’s add the first input instruction to this new rung just as you did in the previous section. </p><p>2. Click and Drag an XIO instruction to rung 1 until you see the green X, then release your mouse button. The XIO instruction eXamines if an Input is Open (a.k.a. a normally closed contact).</p><p>3. With the newly added XIO highlighted, enter the address ‘I:0/1’ and press Enter. </p><p>4. Add a description as shown below and click OK.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 24 of 48 When finished, your rung should appear as follows:</p><p>Let’s add a second input instruction on rung 1. </p><p>5. Click and drag an XIC instruction (eXamine If Closed) down to rung 1, to the right of our XIO instruction, until you see the green X, then release your mouse button.</p><p>6. Using what you learned in the previous steps, address this new instruction as ‘I:0/2’ and add a description of ‘StartButton’. When finished your rung should now look like this. </p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 25 of 48 Putting serial conditions on the rung allows us to look for “AND” conditions. In this case we are asking if the Stop Button is not pressed AND the Start Button is pressed. Both conditions have to be “true” for the rung to be “true”.</p><p>7. Add an OTE instruction (OutpuT Energize) to rung 1 and address it as ‘O:0/1’.</p><p>8. Add a description of ‘Motor1’ so that your rung appears as follows:</p><p>Now let’s add a Branch to rung 1. </p><p>Branches allow for “either / or” programming. For example, we would use branched rungs if we wanted to indicate that either Pushbutton 1 or Pushbutton 2 could be used to turn on an output.</p><p>9. Click on the User tab (to the left of the Bit tab) and then click and hold the left mouse button to drag the Rung Branch button in between the XIO (StopButton) and the XIC (StartButton) instructions on rung 1.</p><p>10. When you see the green X as shown below, release the mouse button.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 26 of 48 11. Verify that your rung appears as follows:</p><p>We must now identify what the “either / or” decision will be. To do this, we need to move the branch around our Start Button. </p><p>12. Click and hold on the right side of the branch leg. Drag the branch leg to the right side of the Start Button. When you see the green X release the mouse button.</p><p>Your rung should now appear as follows:</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 27 of 48 We now need to add an input instruction on our branch. </p><p>13. Using what you learned in the previous steps, click and drag an XIC onto the new branch you just created and address the new XIC as ‘O:0/1’. Your rung should appear as follows:</p><p>You will notice you are entering the same address for this XIC instruction as the output address of your OTE instruction. This is the power of the PLC. What you have just accomplished is the PLC equivalent to auxiliary contacts on a motor starter that allow you to create a ‘Seal In’ circuit. By adding this branch with the OTE address the motor will now stay on when the start button is released, until the stop button is pressed. </p><p>Creating the third ladder logic rung</p><p>1. Using what you’ve learned so far, add another rung as shown below.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 28 of 48 Verifying your ladder logic program </p><p>Program validation or a verification, checks the program you have written for errors. After verification is completed the Results window will open and gives you information about mistakes or omissions that may have been found as your program logic was inspected by the software. </p><p>There are two types of program verification. The first one verifies the file you are currently working in and only this file. The second verifies all files (Main and Subroutines) for the project you created. Because our program only resides in File #2 we will use the first program verification method.</p><p>1. Click on the Verify File button as shown below:</p><p>When the verify has completed and no errors are found all program edit markers (the ‘e’ to the left of the ladder rungs) will disappear and no errors found will be displayed at the bottom of the RSLogix 500 software screen. </p><p>2. If no errors are identified in your logic program proceed to the next section Saving Your Work.</p><p>3. If you have errors in your logic program, those rungs containing the errors will still show the edit markers (the small “e” beside the rung number) as shown below:</p><p>4. From the toolbar menu, select View > Results, or simply press ALT+1 (this window may open automatically if program errors are found). The Verify Results window will appear as shown below:</p><p>RSLogix will take you directly to the errors in your program. </p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 29 of 48 5. Click on the error message in the Verify Results window and you will notice RSLogix 500 highlights the ladder rung and instruction that contains the error.</p><p>6. Go back through the previous lab and correct your error(s). </p><p>Common errors are using letters instead of numbers such as ( O instead of 0 )</p><p>7. After correcting your error(s) verify your file again. </p><p>8. Once all errors are fixed proceed to the next section Saving Your Work.</p><p>Saving your work</p><p>Your project is still not stored on your computer’s hard drive. Save your program to prevent your work from being lost.</p><p>1. Click on the Save button or from the toolbar menu select File > Save.</p><p>2. When the Revision Note box appears, click OK.</p><p>The revision note box will appear. RSLogix 500 software is automatically configured to allow you to enter notes on version changes of your program and back-up older versions of your program as you make changes. This allows you to quickly go back to an older version if you make a mistake. The number of revision copies is configurable and can be turned off if you do not desire to have this feature active.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 30 of 48 Lab3: Testing Your Ladder Logic</p><p>Downloading your ladder logic to the PLC</p><p>1. From the RSLogix 500 toolbar menu, select. Comms > System Comms.</p><p>2. Expand the AB_DF1,DH485 driver by clicking on the + sign in front of the driver.</p><p>3. Highlight the PLC at Node 01 as shown below:</p><p>What you will see displayed on your computer is the file name that is currently running in your lab station controller and not necessarily what is shown above. After we download our program the controller name will change to what we programmed in the previous steps.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 31 of 48 4. Click Download and click OK when the Revision Note window appears.</p><p>5. You will be asked to confirm the download click YES</p><p>6. You may then be prompted to replace the controllers communications settings with your new project settings. Click YES.</p><p>7. If the controller is currently in RUN mode and executing a program the following screen will appear asking to switch the controller to the PROGram mode to begin the download. Click YES.</p><p>The MicroLogix 1200 controller does not have a Mode Switch, so the software is the only way to change the controller’s operating mode from Run to Program. The MicroLogix 1500 controller has a mode switch and when in Remote Run/Prog mode (Mode Switch would be in the center position) the software is able to change the controllers mode. If the Mode Switch on a MicroLogix 1500 controller is in the Run position or the Program position, the software program will not be able to change the operating mode.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 32 of 48 You will see the download progress window appear as the download occurs.</p><p>8. If your controller was in the RUN mode prior to the download RSLogix 500 will ask if you wish to switch the controller back into the RUN mode. Click NO. We will manually switch into the RUN mode in a later step.</p><p>9. You will then be asked if you wish to Go Online with your controller. Click YES.</p><p>Changing the PLC from Program to Run mode</p><p>1. Click on the down arrow next to REMOTE PROG as shown below:</p><p>Notice there are three (3) Run selections for the PLC:</p><p>. Run scans the program and outputs are enabled . Test Continuous scans the program and the outputs are disabled . Test Single Scan performs one scan cycle with outputs disabled</p><p>2. Click Run.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 33 of 48 3. When asked “Are you sure you want to change processor mode to RUN?” click Yes.</p><p>Monitoring and testing your PLC ladder program</p><p>With the PLC in ‘Remote Run’, you can monitor or edit data within the controller. This allows you to make program debugging changes and change data variables while in the run mode. </p><p>When green bars are shown on either side of ladder logic elements this indicates ‘Logical Continuity’, which helps determine how the application is operating and is designed to help you in debugging your application ladder logic. In a relay logic model, this is the same as “current flowing”.</p><p>So now let’s examine your ladder logic in operation.</p><p>1. To test rung 0, enable (Turn On) input switch #0 on the input simulator and examine the front of your MicroLogix controller. Output #0 will turn ON and in your ladder program you see ‘InputSwitch0’ and ‘Output0’ highlight indicating that the input switch and output have been turned on. If you turn off ‘Inputswitch0’ then ‘Output0’ will turn off.</p><p>2. To test rung 1, toggle (ON then OFF) ‘StartButton’ or the third switch on the input simulator. Notice ‘StartButton’ and ‘Motor1’ on the MicroLogix controller turns on. </p><p>Note: Inputs and Outputs are numbered 0,1,2, etc. This means that address I:0/2 is actually the third toggle switch on the input simulator.</p><p>Even after you turn off ‘StartButton’ the motor continues to stay on. The logic decision between StartButton and Motor1 in our input circuit is an “OR”. If either the StartButton is pressed, OR the motor is running, the motor should run. This is a perfect example of a latching circuit also called a 3-wire control circuit. If you toggle ‘StopButton’ (The second switch) on the input simulator, you will see that ‘Motor1’ turns off.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 34 of 48 The two inputs on rung 2 are the outputs of rungs 0 and 1. ‘RunningPilotLight’ will energize (Turn On) when the two inputs are true. So in other words, the outputs from rung 0 and rung 1 must be ON or TRUE to turn on our ‘RunningPilotLight’. This is an example of “AND” ladder logic. </p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 35 of 48 Lab 4: Using Basic Instructions in Ladder Logic</p><p>We are now going to take your program from Lab #2, modify two rungs, and create some new program logic. We are also going to program a Timer and Counter. </p><p>We will then use these in our program to see how they can be used to provide unique control capabilities. The last thing we will do is program a Limit command. The limit command is one of several powerful comparison instructions available in these MicroLogix controllers.</p><p>Going off-line with the PLC</p><p>If you are Online with the MicroLogix you must go Offline to complete this process.</p><p>1. Click the down arrow by the green box that says REMOTE RUN.</p><p>2. Select Go Offline.</p><p>3. If asked to save changes click No.</p><p>Copy and Rename your previous ladder logic program</p><p>1. From the toolbar menu, select File > Save As to create a copy of your program. </p><p>2. Type the File name and Processor Name ‘M-LAB4’ as shown below and then click Save.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 36 of 48 Modifying your existing ladder logic program</p><p>First, let us add an XIO Instruction to rung 1.</p><p>1. Make sure the Program Window is active (the right window title bar is colored or highlighted). If not, click on the title bar to select this window.</p><p>2. Click on the User tab.</p><p>3. Click, hold the left mouse button and drag the XIO button in between the branch and the OTE (remember when you see a green box, release the mouse button).</p><p>4. With the instruction highlighted type ‘C5:0/DN’ and then press Enter. This is the address of the XIO (eXamine If Open) instruction.</p><p>5. When asked to enter a description, type ‘Counter done bit’ and press OK.</p><p>6. When finished, verify that your rung appears as shown below:</p><p>Now, let’s Modify the 1st XIC in rung 2.</p><p>7. Double-click on the first XIC instruction in rung 2. This will open the text edit box for the instruction.</p><p>8. Type ’T4:0/DN’ and press Enter. This will overwrite the existing address. This is one of the most powerful features of a microcontroller, the ability to change the operation of a program through software. To do the same thing in the relay logic realm, an electrician would have to disconnect the wire from a normally open contact (our Input Switch 0 from rung 0) and wire the “done” output of a timer. Besides avoiding the obvious potential for mis-wiring, the microcontroller has the benefit that the timer is already built in.</p><p>9. When asked to enter a description, type ‘Timer done bit’ and click OK.</p><p>10. Verify that your rung now appears as follows:</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 37 of 48 Adding a timer to your ladder logic program</p><p>1. Click, hold and drag the New Rung button over “0003”. </p><p>2. Click, hold and Drag the XIC button onto the left side of the rung you just created. </p><p>3. With the instruction highlighted, type ‘O:0/1’ and Enter. </p><p>Notice as soon as you entered the address ‘O:0/1’ the description ‘Motor1” was automatically shown. Once an address has a description associated with it that description is carried throughout your ladder logic program.</p><p>Your rung should now look like this</p><p>Now let’s add the Timer Instruction.</p><p>4. Click on the Timer/Counter tab near the top of the RSLogix 500 software. </p><p>5. Click, hold and Drag the TON (Timer ON delay) button onto the right side of the rung you just created. </p><p>6. Enter the following parameters for the timer by double-clicking on each parameter in the Timer instruction: . Timer: ‘T4:0’ This is the address of the timer . Description: Motor On Off Timer . Time Base: ‘1.0’ This is the increment that the timer counts, 1 second per count . Preset: ‘10’ This is the value the timer must reach to be done . Accum: ‘0’ This is the elapsed time of the timer while counting Your rung should now look like this:</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 38 of 48 Adding a counter to your ladder logic program</p><p>Using what you have learned so far add a new rung 4.</p><p>1. Add a XIC button onto the left side of the rung you just created. </p><p>2. With the instruction highlighted Type ‘O:0/1’ and then press Enter. Your rung should now look like this:</p><p>3. Click on the Timer/Counter tab and drag the CTU (CounT Up) button onto the right side of the rung you just created. </p><p>4. Enter the following parameters for the counter by double-clicking on each parameter in the Counter instruction: . Counter: ‘C5:0’ This is the address of the counter . Description: Motor On/Off Cycle Counter . Preset: ‘10’ This is the value the counter must reach to be done . Accum: ‘0’ This is the number of counts that the counter has recorded so far Your rung should now look like this:</p><p>Now we need to add an instruction so we can reset our counter.</p><p>5. Add a new rung (rung 5).</p><p>6. Add a XIC button onto the left side of the rung you just created. </p><p>7. Type ‘I:0/3’ and then press Enter. </p><p>8. Enter the description ‘Motor On/Off Counter Reset Switch’ and click OK.</p><p>9. Click on the Timer/Counter tab and drag the RES button onto the right side of the rung you just created (this instruction will allow us to reset our counter).</p><p>10. Type ‘C5:0’ and press Enter. Your rung should now appear as follows:</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 39 of 48 The function of the RES or reset instruction in our program is to zero out the accumulator of our C5:0 counter.</p><p>Adding a Limit instruction to your ladder logic program</p><p>1. Add a new rung (rung 6). </p><p>2. Click on the Compare tab and drag the LIM (Limit instruction) button onto the left side of the rung you just created. (this instruction will allow us to compare the value of our timer against predetermined limits).</p><p>3. Enter the following parameters for the LIM by double-clicking on each parameter in the Limit instruction: . Low Limit: ‘1’ This is the low limit we will use for our comparison . Test: ‘T4:0.ACC’ This is the value we will be evaluating . High Limit: ‘7’ This is the high limit we will use for our comparison</p><p>NOTE: The LIMit instruction is true when the timer is between 1 and 7 seconds. The question marks will disappear when you save the program</p><p>Let’s now add an output instruction to our LIM rung.</p><p>4. Click on the Bit tab and drag the OTE button onto the right side of the LIM rung you just created. </p><p>5. Type ‘O:0/4’ and press Enter.</p><p>6. Following our good programming practices, label your new output address as follows:</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 40 of 48 Your rung should now look like this:</p><p>Verifying your ladder logic program</p><p>Program validation or a verification, checks the program you have written for errors. After verification is completed the Results window will open and gives you information about mistakes or omissions that may have been found as your program logic was inspected by the software. </p><p>There are two types of program verification. The first one verifies the file you are currently working in and only this file. The second verifies all files (Main and Subroutines) for the project you created. Because our program only resides in File #2 we will use the first program verification method.</p><p>1. Click on the Verify File button as shown below:</p><p>When the verify has completed and no errors are found all program edit markers (the ‘e’ to the left of the ladder rungs) will disappear and no errors found will be displayed at the bottom of the RSLogix 500 software screen. </p><p>2. If no errors are identified in your logic program proceed to the next section Adding rung comments to your ladder logic program. </p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 41 of 48 3. Otherwise using the results window at the bottom of RSLogix 500 locate and correct your mistakes.</p><p>REMINDER: To find errors in your ladder logic, click on the error message in the ‘Verify results’ window, the error is then highlighted in the ladder window. Fix the error and then “Verify file” again.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 42 of 48 Adding rung comments to your ladder logic program</p><p>1. Right mouse on rung 6 and select Edit Comment.</p><p>2. Select File/Rung and type the description ‘While the timer accumulator is between 1 and 7 seconds, the LIMit instruction will turn output #4, the 'Motor Starting Pilot Light' ON..</p><p>3. Click OK to accept your changes.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 43 of 48 Rung Comments can be used to describe in detail the function of a rung of ladder logic. This is a good programming practice, and a great feature of RSLogix 500 programming software.</p><p>Your rung should now look like this:</p><p>Saving your work</p><p>1. Click on the Save button.</p><p>2. Click OK for Revision note box. </p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 44 of 48 Downloading the ladder logic program to the PLC</p><p>1. From the toolbar menu, select Comms > System Comms.</p><p>You will notice that there are three primary selections:</p><p>. Online establishes the path . Upload receive from the controller . Download sends to the controller</p><p>2. Highlight the device at Node 01 and then click Download.</p><p>3. Select OK in the Revision note window.</p><p>Note: The revision note feature can be disabled if desired by checking the box in the upper left corner.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 45 of 48 4. Select Yes to download over our ‘M-LAB1’ program that resides in the processor. </p><p>5. If the controller is currently in RUN mode and executing a program the following screen will appear asking to switch the controller to the PROGram mode to begin the download. Click YES.</p><p>You will see the download progress window appear as the download occurs.</p><p>6. If asked to change back to run mode click No.</p><p>7. Select Yes when asked to go online. This will allow you to monitor the program that you just downloaded into your MicroLogix controller.</p><p>8. Click on the down arrow next to REMOTE PROG.</p><p>9. Select Run and then click Yes when the following window appears.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 46 of 48 Monitoring and testing your ladder logic program</p><p>Using the switches and watching the lights does your program work the way you expect? Let’s examine your ladder logic in operation.</p><p>1. RUNG 0 Enable (Turn On) input switch #0 on the input simulator and examine the front of your MicroLogix controller. Output #0 will turn ON and in your ladder program you see ‘InputSwitch0’ and ‘Output0’ highlight indicating that the input switch and output have been turned on. If you turn off ‘InputSwitch0’ then ‘Output0’ will turn off.</p><p>2. RUNG 1 Watching your ladder logic carefully, Toggle (ON then OFF) ‘StartButton’ or the third switch on the input simulator. Notice ‘Motor1’ turns on. Also notice that on rung 3 the timer begins to time because its input condition ‘Output1’ has been turned on and the counter has incremented by one count. Even after you turn off ‘StartButton’ the motor continues to stay on and the timer continues to time. This is a perfect example of a latching circuit also called a 3-wire control circuit. Toggle ‘StopButton’ (The second switch) on the input simulator. You now see that ‘Motor1’ turns off and the timer stops timing.</p><p>3. RUNG 2 The two inputs on rung 2 are the T4:0 done bit and the output conditions of rung 1 (O:0/1). The output ‘RunningPilotLight’ is a condition of these two inputs. In order for our ‘Runningpilotlight’ to turn on the timer needs to time for 10 seconds and Motor1 must be on then output #3 will turn ON. So once the motor has been running for at least 10 seconds the Running Pilot Light will come on.</p><p>4. RUNG 3- In order for the TON (Timer On) to start timing ‘Motor1’ must be on. The Timer starts once the motor starts running up to speed.</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 47 of 48 5. RUNG 4- Each time ‘Motor1’ is toggled from Off to On our counter C5:0 will count up by one. This will allow us to keep track of how many times our motor has been turned on, and schedule maintenance appropriately.</p><p>6. RUNG 5- When our counter reset switch is energized this will reset counter C5:0 back to 0 . When we perform maintenance on the motor, we can reset the counter to keep track of the next maintenance cycle.</p><p>7. RUNG 6- While the timer accumulator is between 1 and 7 seconds, the LIMit instruction will turn output #4 (‘Motor Starting Pilot Light’) ON. This gives us the indication that the motor is starting up, and then turns off to conserve the use of our pilot light.</p><p>CONGRATULATIONS YOU HAVE JUST COMPLETED</p><p>THE BASICS OF PLC’s HANDS ON LAB!</p><p>Basics of PLCs Hands-on Lab</p><p>4/29/2018 Page 48 of 48</p>
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages48 Page
-
File Size-