Lab Exercise 1

Simple Ladder Logic

Table of Contents

Page

Objectives Lab 1-1

Solution Should Include Lab 1-1

I. Wiring the Lights and Switches Lab 1-1

II. Series Operation (Logical AND) Lab 1-6

A. Getting Started with the ControlLogix Lab 1–7

B. Getting Started with the PLC-5 Lab1–10

C. Getting Started with the SLC-500 Lab1–14

D. Programming the Series Circuit Lab 1–17

III. Parallel Operation (Logical OR) Lab 1-21

IV. Motor Start/Stop Lab 1-23

V. Timer Operation Lab 1-23

VI. Counter Operation Lab 1-24

VII. Flashing Lights Lab 1-26

VIII. One-Shot Pulse Lab 1-26

IX. Turn Signal Lab 1-26

X. Cereal Box Filler 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.

ShortLab1.doc

PLC Short Course Lab 1 - 9

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 / Modicon
/ Channel / / / Row / Channel / Address
Start_PB / 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

Have your wiring checked by the instructor before you apply power !!


Fig. 1. Example ControlLogix IB32 DC Input Module Connection Diagram.

Fig. 2. Example ControlLogix OB36I DC Output Module Connection Diagram.


Fig. 3. Example PLC-5 IBD DC Input Module Connection Diagram.

Fig. 4. Example PLC-5 OBD DC Output Module Connection Diagram.

Fig. 5. Example SLC-500 IB16 DC Input Module Connection Diagram.

Fig. 6. Example SLC-500 OB16 DC Output Module Connection Diagram

Fig. 7. Switch and light board connections.


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.

Fig. 8. Series switch circuit and its ladder logic equivalent.


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. specifying modules in the rack

2. assigning tags 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.

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

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.


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 "PLC-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 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 Platform Series

PLC5/11 Enhanced C or D

PLC5/12 Original A

PLC5/20 Enhanced C

PLC5/20E Ethernet C

PLC5/25 Original 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 "PLC-5/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.

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