Lab Exercise 1 Simple Ladder Logic Table of Contents Page Objectives Solution Should Include I. Wiring the Lights and Switches II. Series Operation (Logical AND) A. Getting Started with the ControlLogix B. Getting Started with the PLC-5 C. Getting Started with the SLC-500 D. Programming the Series Circuit III. Parallel Operation (Logical OR) IV. Motor Start/Stop V. Timer Operation VI. Counter Operation VII. Flashing Lights VIII. One-Shot Pulse IX. Turn Signal X. Cereal Box Filler Lab 1-1 Lab 1-1 Lab 1-1 Lab 1-6 Lab 1–7 Lab1–10 Lab1–14 Lab 1–17 Lab 1-21 Lab 1-23 Lab 1-23 Lab 1-24 Lab 1-26 Lab 1-26 Lab 1-26 Lab 1-27 Copyright ©2005, Dogwood Valley Press, LLC. Permission to copy and post these notes granted to instructors of a course that uses Programmable Logic Controllers: An Emphasis on Design and Application by Kelvin T. Erickson. 106753457 Lab 1 - 1 PLC Short Course Objectives This exercise is designed to provide working knowledge of the Allen Bradley ControlLogix, PLC-5, or SLC-500 and the RSLogix software. The PLC is programmed for simple logical operations using ladder logic diagrams and the appropriate software tools. Lamp loads and switches are used to simulate input/output conditions and the ladder logic programs are verified for correct operation. Solution Should Include: Listing of the ladder logic program for each part I. Wiring the Lights and Switches Connect the lights and switches to the I/O modules. Typical connections to the modules are shown in Figures 1 - 6 (Note: these are not the actual connections; you need to figure that out). Use the appropriate figures depending on the PLC (ControlLogix, PLC-5, or SLC-500). A diagram of the switches and lights is shown in Fig. 7. Use the following connections: Allen-Bradley Tag/Symbol/ Variable Group (Slot) Start_PB Modicon Channel ControlLog ix Address PLC - 5/SLC - 500 Address 1 00 1:I:Data.0 I:1/00 1 1 100001 Stop_PB 1 01 1:I:Data.1 I:1/01 1 2 100002 SW3 1 02 1:I:Data.2 I:1/02 1 3 100003 SW4 1 03 1:I:Data.3 I:1/03 1 4 100004 LA1 2 00 2:O:Data.0 O:2/00 2 1 000001 LA2 2 01 2:O:Data.1 O:2/01 2 2 000002 LA3 2 02 2:O:Data.2 O:2/02 2 3 000003 LA4 2 03 2:O:Data.3 O:2/03 2 4 000004 LA5 2 04 2:O:Data.4 O:2/04 2 5 000005 Row Channel Address Have your wiring checked by the instructor before you apply power !! Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 2 PLC Short Course IN-1 IN-3 IN-5 IN-7 IN-9 IN-11 IN-13 IN-15 GND-0 IN-17 IN-19 IN-21 IN-23 IN-25 IN-27 IN-29 IN-31 GND-1 + DC Power Supply - 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 IN-0 IN-2 IN-4 IN-6 IN-8 IN-10 IN-12 IN-14 GND-0 IN-16 IN-18 IN-20 IN-22 IN-24 IN-26 IN-28 IN-30 GND-1 Fig. 1. Example ControlLogix IB32 DC Input Module Connection Diagram. Jumper Bar + DC Power Supply DC-0(+) DC-1(+) DC-2(+) DC-3(+) DC-4(+) DC-5(+) DC-6(+) DC-7(+) DC-8(+) DC-9(+) DC-10(+) DC-11(+) DC-12(+) DC-13(+) DC-14(+) DC-15(+) DC-15(+) Not used 2 1 4 3 6 5 8 7 10 9 12 11 14 13 16 15 18 17 20 19 22 21 24 23 26 25 28 27 30 29 32 31 34 33 36 35 OUT-0 OUT-1 OUT-2 OUT-3 OUT-4 OUT-5 OUT-6 OUT-7 OUT-8 OUT-9 OUT-10 OUT-11 OUT-12 OUT-13 OUT-14 OUT-15 Not used Not used Fig. 2. Example ControlLogix OB36I DC Output Module Connection Diagram. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 3 PLC Short Course + DC Power Supply - A B C D 00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17 E Not used Not used Not used Not used Input 00 Input 07 Input 10 Input 17 DC Common Fig. 3. Example PLC-5 IBD DC Input Module Connection Diagram. + DC Power Supply - A B C D 00 01 02 03 04 05 06 07 10 11 12 13 14 15 16 17 E DC+ DC+ DC+ DC+ Output 00 Output 07 Output 10 Output 17 DC Common Fig. 4. Example PLC-5 OBD DC Output Module Connection Diagram. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 4 PLC Short Course + DC Power Supply - In 00 In 02 In 04 In 06 In 08 In 10 In 12 In 14 DC Com In 01 In 03 In 05 In 07 In 09 In 11 In 13 In 15 DC Com Fig. 5. Example SLC-500 IB16 DC Input Module Connection Diagram. + DC Power Supply - DC+ Out 01 Out 03 Out 05 Out 07 Out 09 Out 13 Out 15 Out 00 Out 02 Out 04 Out 06 Out 10 Out 12 Out 14 DC Com Fig. 6. Example SLC-500 OB16 DC Output Module Connection Diagram Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 5 PLC Short Course DC+ (or L1) DC Common (or L2) Start_PB LA1 Stop_PB LA2 SW3 LA3 SW4 LA4 LA5 Fig. 7. Switch and light board connections. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 6 PLC Short Course II. Series Operation (Logical AND) Two switches in series are used to control a lamp load. The circuit and the corresponding ladder logic is shown in Fig. 8. The input and output addresses are shown in the ladder logic. If programming using the ControlLogix, follow the instructions in parts A. and D. below to set up the processor and enter the program. If programming using the PLC-5, follow the instructions in parts B. and D. below. If programming the SLC-500, follow the instructions in parts C. and D. below. Demonstrate the PLC operation to the instructor. LA1 SW 3 SW3 SW 4 SW4 LA1 Fig. 8. Series switch circuit and its ladder logic equivalent. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 PLC Short Course Lab 1 - 7 A. STARTING A PROJECT WITH THE CONTROLLOGIX Wire the switch/light board before proceeding. Power up the computer, the PLC rack, and external power supply, as needed. Turn the key on the PLC to the REM (middle) position. If RSLinx is not already started, then start the program. If the RSLogix5000 Programming Software main menu is not already displayed, click on the RSLogix5000 icon. The main menu screen should appear with a list of selections. If the error message "Project file does not exist! OK to create it?", click on "Yes". The software will start up in the offline mode and a ladder may be displayed. Communications should already be set up properly. To check that they are properly configured, select Communications | Who Active. Click on "+" box next to "AB_DF1-1" since the Logix5550 is connected with a serial cable to the PC. A processor icon should appear with "1756-L1/A LOGIX5550" and maybe a name of the current program in the processor. Click on Close. If your project is already in the PLC, click on the down arrow beside the small window in the upper left (should have "OFFLINE") and select Go Online. A ladder diagram should appear. Skip to the online programming functions. When starting a project for the first time, it is best to initially set it up offline, and then go online. The initial setup consists of specifying the processor and configuring the discrete I/O modules. 1. Configuring the Processor When starting a project for the first time, check and make sure the OFFLINE/ONLINE window displays "No Controller". From the menu bar select File | New, or click on the paper sheet icon. If you are prompted to close the current project, select Yes. A window titled "New Controller" is displayed. Type in a controller name. Select the proper chassis type (7- or 10-slot) and slot for the processor (probably "0"). Select the proper directory in which the project will be saved (Should be "C:\Projects\RSLogix 5000"). Click on OK. The project data bases will be created. A project window and a large blank area will appear. Set up project communications. On the main menu bar, select Communications | Who Active. Click on "+" box next to "AB_DF1-1" since the Logix5550 is connected with a serial cable to the PC. Select line with "1756-L1/A LOGIX5550". Check box "Apply Current Path to Project". Click on Apply. Click on Close. You are now ready to configure the I/O channels. The OFFLINE/ONLINE window displays "Offline". 2. I/O Configuration Using the RSLogix software, configuration of the inputs and outputs involves two steps: 1. 2. specifying modules in the rack assigning tags to the I/O channels Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 8 PLC Short Course The second step is not absolutely necessary, but it is easier to specify symbols now than when programming the ladder logic. The RSLogix programming software aids the programming of a PLC because one does not need to memorize the I/O addresses and file addresses, but can refer to them symbolically, as a label. Right-click on the I/O Configuration folder in the project tree. A pop-up window will appear. Select New Module... A window titled "Select Module Type" will appear. To specify the I/O modules, In the main part of the window, a list of available modules is displayed. Click on the type of module in slot 1 (a 1756-IB32/A) Click on OK. A window titled "Module Properties" will appear. Enter a name for the module (Suggestion: digital_in). Verify that the slot number is correct (slot 1) and make sure Comm Format is "Input Data". Click on Finish >> to accept the default module configuration.. Slot 1 is now configured for a 32 point discrete input module. Right-click on the I/O Configuration folder in the project tree and add a 1756-OB16I. The steps are similar to the steps to add the discrete input module. Make sure the module name is different from the discrete input module. The Comm Format should be "Output Data". The I/O Configuration folder should have the following subitems: [1] 1756-IB32/A discrete_in [2] 1756-OB16I discrete_out Now assign tags to the input channels. Double-click on the Controller Tags folder in the project tree window. The Controller Tags window will appear. To assign symbols to the discrete input channels, Click on the Edit Tags tab. A table will appear with a white last row. New tags are entered in the last (white) row. Type your tag name, in this case "Start" in the Tag Name column and press <Tab>. Click on the down arrow in the Alias For column. Click on "Local:1:I" and click on the "+" to display the members of this structure. Click on "Local:1:I.Data" and then on the down arrow. Click on the proper bit ("0" in this case). Click on the entry for the Description. The Type for "Start_PB" should change to BOOL. Type in a description in the box, for example, "Start push button switch" and then click back on the box in the Description column. Repeat the above 6 steps to specify the tags and descriptions for the other input and output channels. Now some of the other tags need to be defined. 3. Specifying Other Tags Copyright ©2005, Dogwood Valley Press, LLC. 106753457 PLC Short Course Lab 1 - 9 It is good practice to enter all of the tags (variables) before you start programming. If you enter a rung with undefined tags, errors will be reported. At that point, you can enter new tags into the program and clear the verify errors. In a similar manner as done for the I/O tags, type in tags for a few timers, counters, and booleans. For timers, the data type is TIMER. For counters, the data type is COUNTER. For booleans, the data type is BOOL Now the processor channel information must be specified. 4. Processor Channel Configuration For the Logix5550, the baud rate of the serial port must be set to match the baud rate in the RSLogix communication configuration. Right-click on the Controller (top line) folder in the project tree window. Select Properties Select the Serial Port tab Make sure the baud rate is 19200. Click on OK when finished. Now the processor needs to be downloaded with the blank ladder. 5. Processor Download Click on the down arrow in the OFFLINE/ONLINE window. Select Download. A Download window will pop up. Click on Download. If a window pops up informing you that the communication configuration is different, click on Don't Apply. If a Save Project window appears, click on OK. When a windows pops up and asks if you want to go Online, click on Yes. Skip to the online editing functions, section D1. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 10 PLC Short Course B. STARTING A PROJECT WITH THE PLC-5 Wire the switch/light board before proceeding. Power up the computer, the PLC rack, and external power supply, as needed. Turn the key on the PLC to the REM (middle) position. If RSLinx is not already started, then start the program. If the RSLogix5 Programming Software main menu is not already displayed, click on the RSLogix5 icon. The main menu screen should appear with a list of selections. If the error message "Project file does not exist! OK to create it?", click on "Yes". The software will start up in the offline mode and a ladder may be displayed. Communications should already be set up properly. To check that they are properly configured, select Comms | System Comms.... Click on "+" box next to "AB_DF1-1" since the PLC-5 is connected with a serial cable to the PC. A processor icon should appear with "PLC5/xx" and maybe a name of the current program in the processor. Click on OK. If your project is already in the PLC, click on the down arrow beside the small window in the upper left (should have "OFFLINE") and select Go Online. A ladder diagram should appear. Skip to the online programming functions.When starting a project for the first time, it is best to initially set it up offline, and then go online. The initial setup consists of specifying the processor and configuring the discrete I/O modules. 1. Configuring the Processor When starting a project for the first time, check and make sure the OFFLINE/ONLINE window displays OFFLINE. From the menu bar select File | New, or click on the white sheet icon. If you are prompted to close the current project, select Yes. A window titled "Select Processor Type" is displayed. Type in a project name and select the proper Platform, Processor and Series/Revision. The processor model is indicated on the front of the processor model, toward the very bottom of the front. The current processors, and their platform type is listed in the table below. The memory size is fixed and there is only one selection. Processor PLC5/11 PLC5/12 PLC5/20 PLC5/20E PLC5/25 Platform Enhanced Original Enhanced Ethernet Original Series C or D A C C A Click on Who Active.. to set up project communications. Click on "+" box next to "AB_DF1-1" since the PLC is connected with a serial cable to the PC. Select the line with "PLC5/xx". Click on OK. When finished, click on OK. The project data bases will be created. A project window and an empty ladder will appear. You are now ready to configure the I/O channels. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 11 PLC Short Course 2. I/O Configuration For the PLC-5, specification of the I/O configuration is optional. Using the RSLogix software, configuration of the inputs and outputs involves two steps: 1. specifying modules in the rack 2. assigning symbols to the I/O channels The second step is not absolutely necessary, but it is easier to specify symbols now than when programming the ladder logic. The RSLogix programming software aids the programming of a PLC because one does not need to memorize the I/O addresses and file addresses, but can refer to them symbolically, as a label. Double-click on the IO Configuration icon in the project tree. A window titled "Chassis Table" will appear. For the lab, only one chassis is used, and one should be displayed. The chassis type should be 4 slots or 8 slots (check your chassis) and the Rack Addressing should be "1 Slot". To change the chassis type or rack addressing, Right-click on any field on the chassis row Click on Properties Change the chassis type to the proper one (4 slot or 8 slot) Change the rack addressing to "1-slot" Click OK To display the chassis configuration, Right-click on any field on the chassis row Click on Display Chassis Depending on whether 120 vAC or low voltage DC discrete I/O cards are in your PLC, the I/O Module System Configuration should appear as below (check the sheet that lists the I/O modules for each PLC for last minute changes): Low voltage DC Modules: Slot 0 1 2 R/G/S/C 0/0/0/0 0/1/0/0 0/2/0/0 Module Type I/O Points Description 1771-IBD 1771-OBD 16 16 10-30v DC 16 pt Input 10-60v DC 16 pt Output Module Type I/O Points Description 1771-IAD 1771-OAD 16 16 120v AC 16 pt Input 120v AC 16 pt Output 120 v AC Modules: Slot 0 1 2 R/G/S/C 0/0/0/0 0/1/0/0 0/2/0/0 If the module configuration is not correct, you will need to insert and/or delete modules to modify the configuration that exists. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 12 PLC Short Course To delete a module: Right-click on the entry in the "Module" column (a box surrounds it) Click on Delete Module. The "Detach" radio button should be selected and confirm by clicking on Delete. To insert a module: Double-click on the "Module" column for the appropriate row and a window with all possible I/O modules will appear. Use the scroll bar on the side to display the proper module and single-click on it. (Note: you may just type the proper module type (IAD, OAD, IBD, or OBD) and <Enter>) It will appear in the chassis overview. Close the chassis configuration and I/O Configuration windows by clicking in the "X" in the upper right corner of the window. Now assign symbols to the input channels. Double-click on the Address/Symbol icon in the project tree window. The Address/Symbol Editor window will appear. To assign symbols to the discrete input channels, Click on Add New Record A blank box will appear in the Address column of the table. Type in an address in the format (for START_PB switch) "I:1/00" and press <Tab>. A new row appears in the address table and columns labeled "Symbol" and "Description" will appear and the cursor will be in the "Symbol" column. You will only need to enter information in the "Symbol" column. The "Description" column is optional, though for a real program, you will generally place up to 75 characters of additional descriptive text in this field. If the cursor is not already in the "Symbol" column, click on the symbol column next to address I:001/00 (or use the cursor keys to place the box in this position). Type your symbol name, in this case "START_PB" and press <Enter>. Use the <Tab> or mouse to move the box to the description column and type in a description, for example, "Start push button switch" and then press <Enter> <Enter>. Repeat the above 3 steps to specify the symbols and descriptions for the other input and output channels. When finished, close the window by clicking on the "X" in the upper right corner of the window. Now some of the data files need to be re-sized. 3. Sizing Data Files It is good practice to properly size the data files before you start programming, since you will not be allowed to resize the data files when programming if the processor is in the Run mode. The default data files have only one element, which is not enough for the labs. The B3, T4, and C5 files will be sized to contain 11 elements, numbered from 0-10. In the project tree window, right-click on the icon for "B3 - BINARY". Click on Properties Change the Elements field to "11" and press <Enter>. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 PLC Short Course Lab 1 - 13 Right-click on the icon for "T4 - TIMER". Click on Properties, change the Elements field to "11" and press <Enter>. Right-click on the icon for "C5 - COUNTER". Click on Properties, change the Elements field to "11" and press <Enter>. Now the processor channel information must be specified. 4. Processor Channel Configuration For the enhanced and Ethernet PLC-5’s (PLC-5/11, 5/20, 5/20E), the baud rate of the serial port must be set to match the baud rate in the RSLogix communication configuration. Double-click on the Channel Configuration in the project tree window. Make sure the baud rate is 19200. Click on OK when finished. Now the processor needs to be downloaded with the blank ladder. 5. Processor Download Select Comms | Download.... If a window pops up indicating a mismatch in the processor revision letter, click on Yes. The next window will confirm the change in processor type. Make sure "Resize Data Tables" is checked and then click on OK. If a Save Project window appears, click on OK. When a windows pops up and asks if you want to go Online, click on Yes. Skip to the online editing functions, section D2. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 14 PLC Short Course C. STARTING A PROJECT WITH THE SLC-500 Power up the computer, PLC rack, and external power supply. Turn the key on the PLC to the REM (middle) position. For the most part, programming the SLC-500 series of PLC processors is identical to programming the PLC-5 processors. The major differences in the programs are: The SLC-500 I/O channels are numbered in decimal (versus octal for the PLC-5). The SLC-500 has no slots numbered zero. The SLC-500 instruction set is very close to the original PLC-5 processors. In general, the SLC-500 programming software has a few less features than the PLC-5 programming software. The major differences that one will see are: The I/O configuration must be specified before downloading the initial project and going on-line. Only the SLC 5/04 and 5/05 support on-line editing. For all others, one must edit ladder off-line and download changed program to PLC. Cannot increase size of data tables when editing on-line (only applies to the SLC 5/04 and 5/05 which are the only ones that allow on-line editing) For the most part the procedure to start a project is the same as for the PLC-5. If RSLinx is not already started, then start the program. If the RSLogix500 Programming Software main menu is not already displayed, click on the RSLogix500 icon. The main menu screen should appear with a list of selections. If the error message "Project file does not exist! OK to create it?", click on "Yes". The software will start up in the offline mode and a ladder may be displayed. Communications should already be set up properly. To check that they are properly configured, select Comms | System Comms.... Click on the "+" box next to "AB_DF1-1" since the SLC-5/xx is connected with a serial cable to the PC. A processor icon should appear with "SLC-5/xx" and maybe a name of the current program in the processor. Click on OK. If your project is already in the PLC, click on the down arrow beside the small window in the upper left (should have "OFFLINE") and select Go Online. A ladder diagram should appear. Skip to the online programming functions. When starting a project for the first time, it must initially be set up offline, and then go online. The initial setup consists of specifying the processor and configuring the discrete I/O modules. 1. Configuring the Processor When starting a project for the first time, check and make sure the OFFLINE/ONLINE window displays OFFLINE. From the menu bar select File | New, or click on the white sheet icon. If you are prompted to close the current project, select Yes. A window titled "Select Project Name" is displayed. Check with the lab instructor as to which processor to select (the model number is not on the front of the processor). It will be one of the following: Copyright ©2005, Dogwood Valley Press, LLC. 106753457 PLC Short Course Lab 1 - 15 1747-L542B 5/04 CPU - 32K Mem OS401. 1747-L551B 5/05 CPU - 16K Mem OS501 Series C. Type in a Processor (project) name and click on OK. The project data bases will be created. A project window and an empty ladder will appear. You are now ready to configure the I/O channels. 2. I/O Configuration Using the RSLogix software, configuration of the inputs and outputs involves two steps: 1. specifying modules in the rack 2. assigning symbols to the I/O channels The second step is not absolutely necessary, but it is easier to specify symbols now than when programming the ladder logic. The RSLogix programming software aids the programming of a PLC because one does not need to memorize the I/O addresses and file addresses, but can refer to them symbolically, as a label. Double-click on the IO Configuration icon in the project tree. A window titled "I/O Configuration" will appear. You may need to increase the size of the window in order to see the rack slots. For the lab, only one rack is used. Change rack 1 to be a 1746-A7 7-slot rack. Slot 0 of the rack should already have the proper processor. To specify the I/O modules, In the right side of the window, a list of available modules is displayed. Click on the type of module in slot 1 (use a 1746-I*16 ) While holding down the mouse button, drag the module to slot 1 of the rack. Release the mouse button. Slot 1 is now configured for any 16 point discrete input module. Click on the type of module in slot 2 (use a 1746-O*16 ) While holding down the mouse button, drag the module to slot 2 of the rack. Release the mouse button. Slot 2 is now configured for any 16 point discrete output module. Close the I/O Configuration window by clicking in the "X" in the upper right corner of the window. Now assign symbols to the input channels. Double-click on the Address/Symbol icon in the project tree window. The Address/Symbol Editor window will appear. To assign symbols to the discrete input channels, Click on Add New Record A blank box will appear in the Address column of the table. Type in an address in the format (for START_PB switch) "I:1/00" and press <Tab>. A new row appears in the address table and columns labeled "Symbol" and "Description" will appear and the cursor will be in the "Symbol" column. You will only need to enter information in the "Symbol" column. The "Description" column is optional, though for a real program, you will generally place up to 75 characters of additional descriptive text in this field. If the cursor is not already in the "Symbol" column, click on the symbol column next to address I:001/00 (or use the cursor keys to place the box in this position). Type your symbol name, in this case "START_PB" and press <Enter>. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 16 PLC Short Course Use the <Tab> or mouse to move the box to the description column and type in a description, for example, "Start push button switch" and then press <Enter> <Enter>. Repeat the above 3 steps to specify the symbols and descriptions for the other input and output channels. When finished, close the window by clicking on the "X" in the upper right corner of the window. Now some of the data files need to be re-sized. 3. Sizing Data Files It is good practice to properly size the data files before you start programming, since you will not be allowed to resize the data files when programming on-line. The default data files have only one element, which is not enough for the labs. The B3, T4, and C5 files will be sized to contain 11 elements, numbered from 0-10. In the project tree window, right-click on the icon for "B3 - BINARY". Click on Properties Change the Elements field to "11" and press <Enter>. Right-click on the icon for "T4 - TIMER". Click on Properties, change the Elements field to "11" and press <Enter>. Right-click on the icon for "C5 - COUNTER". Click on Properties, change the Elements field to "11" and press <Enter>. Now the processor channel information must be specified. 4. Processor Channel Configuration For the SLC-5/03, SLC-5/04 and SLC-5/05, the baud rate of the serial port must be set to match the baud rate in the RSLogix comm configuration. Double-click on the Channel Configuration in the project tree window. Select the Chan. 0 - System tab Set the baud rate to 19200. Select the Chan. 0 - User tab Set the baud rate to 19200. Click on OK when finished. Now the processor needs to be downloaded with the blank ladder. 5. Processor Download Select Comms | Download.... A revision note window may pop up. Either type in a note, or just click on OK. If a window pops up indicating a mismatch in the processor revision letter, click on Yes. A confirmation window will pop up. Click on Yes. If a window pops up informing you that the communication confguration is different, click on Don't Apply. If a Save Project window appears, click on OK. When a window pops up and asks if you want to go Online, click on Yes. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 17 PLC Short Course LA1 SW 3 SW3 SW 4 SW4 LA1 Fig. 8. Series switch circuit and its ladder logic equivalent. D. PROGRAMMING THE SERIES CIRCUIT 1. RSLogix5000 for ControlLogix The OFFLINE/ONLINE box should show "REMOTE PROG" backlighted in blue. The steps necessary to program the first part of the experiment, the series rung, will be explained in detail. For the other parts of the exercise, only the different steps required to do these parts are explained. The first ladder program to be implemented will be a simple series control rung. Two switches, SW3 and SW4, will be placed in series and will be used to control a single light, LA1. Use the right mouse button to access editing functions whenever possible. Clicking on the right mouse button brings up the editing menu with available options. The menu is different depending on the (box) cursor location. If the box is on the left rail of a rung, rung editing functions: accept, cancel, cut, paste, append rung, insert rung, etc. If the box is on an instruction, then instruction editing functions are presented if the right mouse button is clicked: append/insert instruction, insert/append branches, change instruction type, cut, paste, etc. As you place the instructions into a ladder program, one can either append or insert the instruction. Append places the new instruction to the right of the current cursor position, and insert places the instruction to the left. If the cursor is on the left power rail, append or insert will append or insert a rung. Appended rungs are placed below the current rung, and inserted rungs are placed above the current rung. If ladder window is not displayed, double-click on “MainRoutine” under “Main Task” in the project window. Place the cursor (blue box) on the END rung. If not, click on the left rail of the bottom rung. Click on the Insert Rung icon (├─┤). A new rung appears at the top of the screen with a blue box on the left. The "e" in the box indicates this is an edit zone. Now the individual instructions for the new rung will be entered. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 18 PLC Short Course A normally open (NO) relay contact is needed at the input, so click on the appropriate contact symbol (┤├) above the ladder window. Move the cursor arrow tip close to the left side of the rung and click the mouse. The NO contact will appear with a box around it and a question mark above it. Switch SW3 will be used first, so type the tag for that switch ("SW3") and press <Enter>. The symbolic and physical address of the relay that controls the contact will appear above the contact symbol on the ladder diagram. Click on the ┤├ contact symbol above the ladder window and then click on the new rung to the right of the first contact and add a second NO relay in series with the first. Use the symbol or address for switch SW4 ("SW4") for this contact. The output for this rung will be light LA1. Click on the output coil symbol (-( )-) above the ladder window. Move the cursor to the right side of the rung and click the mouse. A normal output coil symbol will appear with a box above it. Type the symbol or address for light LA1 ("LA1"). Since the output instruction has been entered, the rung edits may now be accepted. Click on the left rail of the rung. A blue box appears. Click the right mouse button. Click on Accept Rung Edits. Now the rung is loaded into the controller's memory. The "e" indications on the left side of the rung should disappear. To change the processor to the run mode use the following keystrokes: Click on the arrow to the right of "REMOTE PROG" box Click on Run Click on Yes The controller is now set to respond to input conditions and perform appropriate output commands. The ladder power rails change to green, indicating the processor in the run mode. Try the input switches in various combinations and observe the output. Also observe the changing status of ladder components on the screen. Energized or true conditions cause the elements to be highlighted on the ladder diagram. 2. RSLogix for PLC-5/SLC-500 The OFFLINE/ONLINE box should show "REMOTE PROG" backlighted in blue. The steps necessary to program the first part of the experiment, the series rung, will be explained in detail. For the other parts of the exercise, only the different steps required to do these parts are explained. The first ladder program to be implemented will be a simple series control rung. Two switches, SW3 and SW4, will be placed in series and will be used to control a single light, LA1. Use the right mouse button to access editing functions whenever possible. Clicking on the right mouse button brings up the editing menu with available options. The menu is different Copyright ©2005, Dogwood Valley Press, LLC. 106753457 PLC Short Course Lab 1 - 19 depending on the (box) cursor location. If the box is on the left rail of a rung, rung editing functions: accept, cancel, cut, paste, append rung, insert rung, etc. If the box is on an instruction, then instruction editing functions are presented if the right mouse button is clicked: append/insert instruction, insert/append branches, change instruction type, cut, paste, etc. As you place the instructions into a ladder program, one can either append or insert the instruction. Append places the new instruction to the right of the current cursor position, and insert places the instruction to the left. If the cursor is on the left power rail, append or insert will append or insert a rung. Appended rungs are placed below the current rung, and inserted rungs are placed above the current rung. If the ladder window is not displayed, double-click on “LAD 2” under “Program Files” in the project window. Place the cursor (red box) on the END rung. If not, click on the left rail of the bottom rung. Click on the Insert Rung icon (…├─┤). A new rung appears at the top of the screen with a red box on the left. The "e" in the box indicates this is an edit zone. Now the individual instructions for the new rung will be entered. A normally open (NO) relay contact is needed at the input, so click on the appropriate contact symbol (┤├) above the ladder window. Move the cursor arrow tip close to the left side of the rung and click the mouse. The NO contact will appear with a box around it and a question mark above it. Switch SW3 will be used first, so type the symbol or address for that switch ("SW3" or "I:1/02") and press <Enter>. The symbolic and physical address of the relay that controls the contact will appear above the contact symbol on the ladder diagram. Click on the ┤├ contact symbol above the ladder window and then click on the new rung to the right of the first contact and add a second NO relay in series with the first. Use the symbol or address for switch SW4 ("SW4" or "I:1/03") for this contact. The output for this rung will be light LA1. Click on the output coil symbol (-( )-) above the ladder window. Move the cursor to the right side of the rung and click the mouse. A normal output coil symbol will appear with a box above it. Type the symbol or address for light LA1 ("LA1" or "O:2/00"). Since the output instruction has been entered, the rung edits may now be accepted. Click on the left rail of the rung. A red box appears. Click the right mouse button. Click on Accept Rung Edits. Now the rung is loaded into the controller's memory. The "e" indications on the left side of the rung should disappear. To change the processor to the run mode use the following keystrokes: Click on the arrow to the right of "REMOTE PROG" box Click on Run Click on Yes The controller is now set to respond to input conditions and perform appropriate output commands. The ladder power rails change to green, indicating the processor in the run mode. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 20 PLC Short Course Try the input switches in various combinations and observe the output. Also observe the changing status of ladder components on the screen. Energized or true conditions cause the elements to be highlighted on the ladder diagram. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 21 PLC Short Course III. Parallel Operation (Logical OR) Connect two switches in parallel, as shown in Fig. 9, which is a logical OR condition. The instructions to program the PLC are below. Demonstrate the PLC operation to the instructor. LA1 SW 3 SW 4 Fig. 9. Parallel switch circuit. 1. RSLogix for ControlLogix Change the processor back to program mode: Click on the arrow to the right of "REMOTE RUN" box Click on Program Click on Yes Either insert a new rung, or start rungs edits on an existing rung, placing the cursor on the instruction that will parallel the new branch. To start the branch: Place the cursor on the contact that will parallel the new branch. Click on the branch icon (looks like a “branch”) above the ladder window or right click the mouse and select Insert New Branch A branch will appear to the right of the cursor with a blue box surrounding the right side of the branch Place the mouse cursor on the blue box and hold down the mouse button as you drag the branch to the desired location of this side of the branch, usually on the other side of an instruction. The blue oval on the rung that changes to green indicates the location of this branch leg. Release the mouse button and the program will place the branch. Instructions are entered on branches just as if they were a separate rung. To make a series of parallel branches that have parallel sides (instead of nesting, which looks like an inverted tree), the branch is extended down. Place the cursor on the lower left corner of the branch. Right click the mouse Select Extend Branch Down A branch will appear below the existing branch and parallel with the existing branch Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 22 PLC Short Course 2. RSLogix for PLC-5/SLC-500 Change the processor back to program mode: Click on the arrow to the right of "REMOTE RUN" box Click on Program Click on Yes Either insert a new rung, or start rungs edits on an existing rung, placing the cursor on the instruction that will parallel the new branch. To start the branch: Place the cursor on the contact that will parallel the new branch. Right click the mouse. Select Insert New Branch A branch will appear before the cursor with a red box surrounding the right side of the branch Place the mouse cursor on the red box and hold down the mouse button as you drag the branch to the desired location of the right side of the branch, usually on the other side of an instruction. The red rectangular box on the rung that changes to green indicates the location of the other leg of the branch. Release the mouse button and the program will place the branch. Instructions are entered on branches just as if they were a separate rung. To make a series of parallel branches that have parallel sides (instead of nesting, which looks like an inverted tree), the branch is extended down. Place the cursor on the lower left corner of the branch. Right click the mouse Select Extend Branch Down A branch will appear below the existing branch and parallel with the existing branch Copyright ©2005, Dogwood Valley Press, LLC. 106753457 PLC Short Course Lab 1 - 23 IV. Motor Start/Stop Using the Start and Stop switches and one lamp, implement a motor start/stop circuit. The start switch is a normally open pushbutton switch and the stop switch is a normally closed pushbutton switch. Demonstrate the PLC operation to the instructor. V. Timer Operation Devise a ladder logic program to do the following: a. When a switch is closed, one lamp lights. b. Five seconds later, another lamp lights. Demonstrate the PLC operation to the instructor. 1. RSLogix for ControlLogix To enter a timer into a rung, position the cursor on the right side of the rung, or to the left of where you want to place the instruction. Click on the Timer/Counter tab above the ladder window and click on TON. A timer instruction will appear at the right side of the rung. A box with a cursor will appear. Type the tag in the “Timer” field and press <Enter> Type the preset value and press <Enter> Type the initial accumulator value and press <Enter> Other types of timer instructions are selected by clicking on the Timer/Counter tab and then the appropriate mnemonic (TON, TOF, RTO, or RES (reset timer)). Note: to refer to the timer done bit in a contact address, use "timer_tag.DN". 2. RSLogix for PLC-5/SLC-500 To enter a timer into a rung, position the cursor on the right side of the rung, or to the left of where you want to place the instruction. Click on the Timer/Counter tab above the ladder window and click on TON. A timer instruction will appear at the right side of the rung. A box with a cursor will appear. At this point, you have two options: 1. Type the timer address, e. g., "T4:1", and press <Enter> 2. Type a symbolic name, e. g., "TIMERA" and press <Enter>. If an address has not already been assigned to this symbol, then a warning message will appear at the bottom of the screen. You will have to use the database symbol/description to assign the symbol. Your rung edits will not be accepted until you assign an address to that symbol. Click on the symbolic name to highlight it. Now double click on Database-Address/Symbol in the project tree window. The record for the Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 24 PLC Short Course symbol will appear, allowing you to type in an address, followed by <Enter>. Click on the icon in the upper right to finish with the address/symbol editor. Select the timer base, 0.01 or 1 second and press <Enter> Type the preset value and press <Enter> Type the initial accumulator value and press <Enter> Other types of timer instructions are selected by clicking on the Timer/Counter tab and then the appropriate mnemonic (TON, TOF, RTO, or RES (reset timer)). Note: to refer to the timer done bit in a contact address, use "symbol.DN" or "address.DN". VI. Counter Operation Devise a ladder logic program to do the following: When a switch is closed five times, one lamp lights. Demonstrate the PLC operation to the instructor. 1. RSLogix for ControlLogix Counter blocks are placed in the ladder rung in much the same way as timers. To enter an up counter into a rung, first click on the CTU and position the arrow on the right side of the rung. Click the mouse. A CTU instruction will appear at the right side of the rung. A box with a cursor will appear. Type the tag in the “Counter” field and press <Enter> Type the preset value and press <Enter> Type the initial accumulator value and press <Enter> For other types of counter instructions are selected by clicking on the Timer/Counter tab and then the appropriate mnemonic (CTU, CTD, or RES (reset timer)). Note: to refer to the counter done bit in a contact address, use "counter_tag.DN". 2. RSLogix for PLC-5/SLC-500 Counter blocks are placed in the ladder rung in much the same way as timers. To enter an up counter into a rung, first click on the CTU and position the arrow on the right side of the rung. Click the mouse. A CTU instruction will appear at the right side of the rung. A box with a cursor will appear. At this point, you have two options: 1. Type the counter address, e. g., "C5:1" and press <Enter> Copyright ©2005, Dogwood Valley Press, LLC. 106753457 PLC Short Course Lab 1 - 25 2. Type a symbolic name, e. g., "COUNTA" and press <Enter>. If an address has not already been assigned to this symbol, then a warning message will appear at the bottom of the screen. You will have to use the database symbol/description to assign the symbol. Your rung edits will not be accepted until you assign an address to that symbol. Click on the symbolic name to highlight it. Now double click on Database-Address/Symbol in the project tree window. The record for the symbol will appear, allowing you to type in an address, followed by <Enter>. Click on the icon in the upper right to finish with the address/symbol editor. Type the preset value and press <Enter> Type the initial accumulator value and press <Enter> For other types of counter instructions are selected by clicking on the Timer/Counter tab and then the appropriate mnemonic (CTU, CTD, or RES (reset timer)). Note: to refer to the counter done bit in a contact address, use "symbol.DN" or "address.DN". Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 26 PLC Short Course VII. Flashing Lights. Devise ladder logic using two lamps and two timers to make the two lamps flash alternately. Choose any on/off period. Use one of the switches to turn the flashing lights on and off. Demonstrate the PLC operation to the instructor. You will need to use this ladder logic for the heating and ventilation lab exercise. VIII. One-Shot Pulse. Devise ladder logic using the start switch, one lamp, and one timer to produce a five second one-shot signal (indicated by the lamp). When the start switch is pressed, the lamp should light for five seconds and then turn off. Pressing the start switch should have no effect when the light is on (the light should not go out, nor should the light remain on any longer). When the lamp turns OFF, another press of the start switch should start the process over. If the start switch is held down, the lamp should light for five seconds and turn off. The lamp should not turn on until the start switch is released and pressed again. Demonstrate the PLC operation to the instructor. You will need to use this ladder logic for the conveyor lab exercise. IX. Turn Signal. Devise ladder logic using SW3 and SW4 and timers to produce a turn signal indication (like the old Thunderbirds) with the five lamps. If SW3 is on, the lights should flash to show a left turn. The sequence should be ●●●●○, ●●●○○, ●●○○○, ●○○○○, ○○○○○, ●●●●● (where ○ means a lamp is on and ● means lamp off). If SW4 is on, the lights should flash to signal a right turn. The right turn sequence should be ○●●●●, ○○●●●, ○○○●●, ○○○○●, ○○○○○, ●●●●●. If both switches are on, then no lamps should flash. The patterns should repeat as long as either switch is on. Each "pattern" in the sequence should be displayed. There should be a time interval for which no outputs are on. Choose any reasonable timing intervals. Demonstrate the PLC operation to the instructor. Copyright ©2005, Dogwood Valley Press, LLC. 106753457 PLC Short Course Lab 1 - 27 X. Cereal Box Filler Example. Enter the ladder logic for the cereal box filling operation used as a class example. The following description is the same as used in class, except the timer values are changed. The reset switch does not exist, and will be simulated by using the forcing function of the RSLogix or Concept software (the switch/lighting board has only 4 switches). The RSLogix and Concept chapters explain how to force inputs. You will be required to manually change the limit switch and the weight sensor switch (SW3 is limit switch, SW4 is the weight sensor). Demonstrate the PLC operation to the instructor. Put comments in your ladder. Design a ladder logic diagram to control for the following bottler machine. A figure of the system is shown below. Upon initial startup, motor M1 runs until an empty box is the proper position, which is detected by the limit switch, LS. Wait 2.0 seconds and then fill the box until the weight sensor detects a full box. After the box is filled, wait 3.0 seconds to continue to the next box. If the stop switch is pressed at any time, the box filler is paused at the current step. When the start switch is pressed while the operation is paused, the box filler should resume the suspended step. When the box filler is paused, the motors should be shut off and the filler solenoid should be turned off, and all timer values should be retained. A separate reset switch is provided which resets the timers and any internal steps so that when the start switch is pressed, no box is assumed to be in the filling position. The reset switch should be ignored if the box filler is running. Motor M2 runs continuously (unless paused). Assume the following input and output assignments: CLogix PLC-5 Tag/Symbol 1:I:Data.0 I:1/00 START_PB Start pushbutton, N. O., ON when starting 1:I:Data.1 I:1/01 STOP_PB Stop pushbutton, N. C., OFF when stopping 1:I:Data.2 I:1/02 LS Limit switch, N. O., ON (closed) when box in position 1:I:Data.3 I:1/03 WT_SENSE Weight sensor switch, N. O., ON (closed) when box full 1:I:Data.4 I:1/04 RESET_PB Reset, N. O., ON when resetting the internal steps 2:O:Data.0 O:2/00 M1 Motor, ON to run infeed conveyor 2:O:Data.1 O:2/01 M2 Motor, ON to run outfeed conveyor 2:O:Data.2 O:2/02 FILL Filler solenoid, ON to fill box Copyright ©2005, Dogwood Valley Press, LLC. 106753457 Lab 1 - 28 PLC Short Course Figure 10. Cereal Box Filling Station Copyright ©2005, Dogwood Valley Press, LLC. 106753457