Home

LogixPro
Relay Logic
Introductory Lab


 

RSLogix Relay Logic Instructions

This exercise is designed to familiarize you with the operation of LogixPro and to step you through the process of creating, editing and testing simple PLC programs utilizing the Relay Logic Instructions supported by RSLogix.

From the Simulations Menu at the top of the screen, Select the I/O Simulation and ensure that the User Instruction Bar shown above is visible.

The program editing window should contain a single rung. This is the End of Program rung and is always the last rung in any program. If this is the only rung visible then your program is currently empty.

If your program is not empty, then click on the File menu entry at the top of the screen and select "New" from the drop-down list. A dialog box will appear asking for you to select a Processor Type. Just click on "OK" to accept the default TLP LogixPro selection.

Now maximize the ProSim-II Simulation Window

The I/O Simulator

The simulator screen shown above, should now be in view. For this exercise we will be using the I/O simulator section, which consists of 32 switches and lights. Two groups of 16 toggle switches are shown connected to 2 Input cards of our simulated PLC. Likewise two groups of 16 Lights are connected to two output cards of our PLC. The two input cards are addressed as "I:1" and "I:3" while the output cards are addressed "O:2" and "O:4".

Use your mouse to click on the various switches and note the change in the status color of the terminal that the switch is connected to. Move your mouse slowly over a switch, and the mouse cursor should change to a hand symbol, indicating that the state of switch can be altered by clicking at this location. When you pass the mouse over a switch, a "tool-tip" text box also appears and informs you to "Right Click to Toggle Switch Type". Click your right mouse button on a switch, and note how the switch type may be readily changed.

RSLogix Program Creation

Collapse the I/O simulation screen back to it's normal size by clicking on the same (center) button you used to maximize the simulation's window. You should now be able to see both the simulation and program windows again. If you wish, you can adjust the relative size of these windows by dragging the bar that divides them with your mouse.

I want you to now enter the following single run program which consists of a single Input instruction (XIC - Examine If Closed) and a single Output instruction (OTE - Output Energize). There's more than one way to accomplish this task, but for now I will outline what I consider to be the most commonly used approach.

First click on the "New Rung" button in the User Instruction Bar. It's the first button on the very left end of the Bar. If you hold the mousepointer over any of these buttons for a second or two, you should see a short "ToolTip" which describes the function or name of the instruction that the button represents.

You should now see a new Rung added to your program as shown above, and the Rung number at the left side of the new rung should be highlighted. Note that the new Rung was inserted above the existing (END) End Of Program Rung. Alternatively you could have dragged (left mouse button held down) the Rung button into the program window and dropped it onto one of the locating boxes that would have appeared.

Now click on the XIC instruction with your left mouse button (Left Click) and it will be added to the right of your highlighted selection. Note that the new XIC instruction is now selected (highlighted). Once again, you could have alternatively dragged and dropped the instruction into the program window.

If you accidentally add an instruction which you wish to remove, just Left Click on the instruction to select it, and then press the "Del" key on your keyboard. Alternatively, you may right click on the instruction and then select "Cut" from the drop-down menu that appears.

Left Click on the OTE output instruction and it will be. added to the right of your current selection.

Double Click (2 quick left mousebutton clicks) on the XIC instruction and a textbox should appear which will allow you to enter the address (I:1/0) of the switch we wish to monitor. Use the Backspace key to get rid of the "?" currently in the textbox. Once you type in the address, click anywhere else on the instruction (other than the textbox) and the box should close.

Right Click on the XIC instruction and select "Edit Symbol" from the drop-down menu that appears. Another textbox will appear where you can type in a name (Switch-0) to associate with this address. As before, a click anywhere else will close the box.

Enter the address and symbol for the OTE instruction and your first RSLogix program will now be complete. Before continuing however, Double check that the addresses of your instructions are correct.

 

Testing your Program

It's now time to "Download" your program to the PLC. First click on the "Toggle" button at the top right corner of the Edit Panel which will bring the PLC Panel into view.

Click on the "DownLoad" button to initiate the downloading of your program to the PLC. Once complete, click inside the "RUN" option selection circle to start the PLC scanning.

Enlarge the Simulation window so that you can see both the Switches and Lamps, by dragging the bar that separates the Simulation and Program windows to the right with your mouse. Now click on Switch I:1/00 in the simulator and if all is well, Lamp O:2/00 should illuminate.

Toggle the Switch On and Off a number of times and note the change in value indicated in the PLC Panel's status boxes which are being updated constantly as the PLC Scans. Try placing the PLC back into the "PGM" mode and then toggle the simulator's Switch a few times and note the result. Place the PLC back into the "Run" mode and the Scan should resume.

We are usually told to think of the XIC instruction as an electrical contact that allows electrical flow to pass when an external switch is closed. We are then told that the OTE will energize if the flow is allowed to get through to it. In actual fact the XIC is a conditional instruction which tests any bit that we address for Truth or a 1.

 

Editing your Program

Click on the "Toggle" button of the PLC Panel which will put the PLC into the PGM mode and bring the Edit Panel back into view.

Now add a second rung to your program as shown below. This time instead of entering the addresses as you did before, try dragging the appropriate address which is displayed in the I/O simulation and dropping it onto the instruction.

Note that the XIC instruction which Tests for Zero or False has it's address highlighted in yellow. This indicates that the instruction is True, which in the case of an XIC, means that the bit addressed is currently a Zero or False.

This is probably a good time to practice your dragNdrop skills. Try moving instructions from rung to rung by holding the left mouse button down while over an instruction, and then while keeping the mouse button down, move the mouse (and instruction) to a new location. Try doing the same with complete rungs by dragging the box at the left end of the rung and dropping it in a new location.

Once you feel comfortable with dragNdrop, ensure that your program once again looks like the one pictured above, Now download your program to the PLC and place the PLC into the Run Mode. Toggle both Switch-0 and Switch-1 on and off a number of times and observe the effects this has on the lamps. Ensure that you are satisfied with the operation of your program before proceeding further.

 

Stop/Start utilizing OTL and OTU

For this exercise we need two Normally Open momentary switches. Using your right mouse button, click on switch "I:1/2" and "I:1/3", changing them to N.O. pushbuttons. Now add the following two rungs to your program. Once you have the rungs entered correctly, download and run your modified program.

Activate the Start and Stop switches and ensure that the OTL and OTL output instructions are responding as outlined in your text. Once you have the lamp ON, could you turn it off if power was lost in the Stop Switch circuit?

Now modify your program so that it operates correctly when you substitute the N.O. Stop switch (I:1/03) with a Normally Closed Switch. If we now lost power on the N.C. Stop switch circuit, what would happen to the state of Lamp (O:2/02)?

 

Emulating Standard Stop/Start Control

Erase your program by selecting "New" from the "File" menu selection at the top of the screen. When the dialog box appears just click on "OK" to select the default PLC type. Now enter the following program. To enter a branch, just drag the branch (button) onto the rung and then insert or drag instructions into the branch.

Before you download and run this program, take a careful look at our use of a XIO instruction to test the state of the N.C. Stop Switch. When someone presses the Stop Switch, will bit I:1/04 go True or False? Will the XIC instruction go True or False when the Switch is pressed? Is this the logic we are seeking in this case? .... Run the program and see if you're right! .... If we loose power in the Stop Switch circuit, what state will the lamp go to? .... Why do you think that most prefer this method rather than the OTL/OTU method of implementing Stop/Start Control?

 

Output Branching with RSLogix

Modify your program so that it matches the following.

Download and Run the program. Operate the Stop and Start switches several times with Switch-0 open, and again with Switch-0 closed. Remove the XIC instruction from the Output branch and note what happens to Lamp-3 when you Start and Stop the circuit. Try moving the Lamp-3 OTE instruction so that it is in series with the Lamp-2 OTE instruction. Download, Run and observe how both lamps still light even with the empty branch (short?) in place. It may look like an electrical circuit but in fact we know that it isn't and therefore obeys a somewhat different set of rules. Remove the empty branch, Download, Run and see if this has any effect on the logic or operation of the rung.

 

Controlling One Light from two Locations

Create, enter and test a program which will perform the common electrical function of controlling a light from two different locations. Clear your program and utilize toggle switch (I:1/00) and switch (I:1/01) to control Lamp (O:2/00)... (Hint: If both switches are On or if both switches are Off, then the Lamp should be On! This of course is just one approach to solving this problem)

 

......