0% found this document useful (0 votes)
405 views36 pages

LogixPro Simulator

The LogixPro Lab Manual provides instructions for creating, editing, and testing PLC programs using Relay Logic Instructions. It includes exercises on program creation, testing, editing, and controlling devices like doors with various logic scenarios. The manual emphasizes hands-on practice with simulations and encourages students to design and document their programs effectively.

Uploaded by

clementmawa8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
405 views36 pages

LogixPro Simulator

The LogixPro Lab Manual provides instructions for creating, editing, and testing PLC programs using Relay Logic Instructions. It includes exercises on program creation, testing, editing, and controlling devices like doors with various logic scenarios. The manual emphasizes hands-on practice with simulations and encourages students to design and document their programs effectively.

Uploaded by

clementmawa8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 36

Programmable Logic Controllers (PLC)

LogixPro Lab. Manual

Objectives: 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.

Prepared by: Emmanuel K. Kokumo

Arusha Technical College

June 2020
1
Exercise 1

General Instructions
1. 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.

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

3. 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.

4. Now maximize the ProSim-II Simulation Window

5. Use your mouse to click on the various switches on the I/O simulator side and note the change in the
status color of the terminal that the switch is connected to.
6. 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.
7. 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".
8. Click your right mouse button on a switch, and note how the switch type may be readily changed.

2
Exercise 2

A. RSLogix Program Creation


1. Minimize the I/O simulation screen back to it's normal size to be able to see both the simulation and
program windows again.
2. If you wish, you can adjust the relative size of these windows by dragging the bar that divides them with
your mouse.
3. Enter the following single rung program which consists of a single Input instruction (XIC - Examine If
Closed) and a single Output instruction (OTE - Output Energize).

3.1 First click on the "New Rung" button in the User Instruction Bar. to create a new rung with
highlighted number.

3.2 Click on the XIC instruction with your left mouse button (Left Click) or drag and drop the
instruction into the program window to add it to the right of your highlighted selection.

Note: 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.

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

3.4 Double Click 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 and use the Backspace key to get rid of the "?"
currently in the textbox.
3.5 Once you typed in the address, click anywhere else on the instruction (other than the textbox) and
the box should close.
3.6 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.
3.7 Do the same as 3.4 – 3.6 for the OTE address and name. Your program is now complete.

Note: Before continuing however, Double check that the addresses of your instructions are
correct.

3
B. Testing your Program
1. First click on the "Toggle" button at the top right corner of the Edit Panel which will bring the PLC
Panel into view.

2. Click on the "DownLoad" button to initiate the downloading of your program to the PLC.
3. Click inside the "RUN" option selection circle to start the PLC scanning.
4. 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.
5. Click on Switch I:1/00 in the simulator and if all is well, Lamp O:2/00 should illuminate.
6. 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.
7. Try placing the PLC back into the "PGM" mode and then toggle the simulator's Switch a few times
and note the result.
8. Place the PLC back into the "Run" mode and the Scan should resume.

C. Editing your Program


1. 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.
2. 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 XIO 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 XIO, means that the bit addressed is currently a Zero or
False.

3. Practice your dragNdrop skills by moving instructions from rung to rung.


4. Download your program to the PLC and place the PLC into the Run Mode.
5. Toggle both Switch-0 and Switch-1 on and off a number of times and observe the effects this has on
the lamps.
NB: Ensure that you are satisfied with the operation of your program before proceeding
further

4
Exercise 3

A. Stop/Start utilizing OTL and OTU


1. Using your right mouse button, click on switch "I:1/2" and "I:1/3", changing them to N.O.
pushbuttons.
2. Add the following two rungs to your program. Once you have the rungs entered correctly, download
and run your modified program.

3. Activate the Start and Stop switches and ensure that the OTL and OTU output instructions are
responding as outlined in your text.
4. Qn: Once you have the lamp ON, could you turn it off if power was lost in the Stop Switch circuit?
5. Modify your program so that it operates correctly when you substitute the N.O. Stop switch (I:1/03)
with a Normally Closed Switch.
6. Qn: If we now lost power on the N.C. Stop switch circuit, what would happen to the state of Lamp
(O:2/02)?

B. Emulating Standard Start/Stop Control


1. Erase your program by selecting "New" from the "File" menu selection at the top of the screen.
2. When the dialog box appears just click on "OK" to select the default PLC type.
3. 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.

Qns: 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?

4. Run the program and see if you're right!

Qns: 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?

5
C. Output Branching with RSLogix
1. Modify your program so that it matches the following.

2. Download and Run the program.


3. Operate the Stop and Start switches several times with Switch0 open, and again with Switch-0 closed.
4. Remove the XIC instruction from the Output branch and note what happens to Lamp-3 when you
Start and Stop the circuit.
5. Try moving the Lamp-3 OTE instruction so that it is in series with the Lamp-2 OTE instruction.
6. 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.
7. Remove the empty branch, Download, Run and see if this has any effect on the logic or operation of
the rung.

D. Controlling One Light from two Locations (Exercise)


1. Create, enter and test a program which will perform the common electrical function of controlling a
light from two different locations.
2. 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)

6
LAB. EXERCISE 4, EXPLANATION

Door Simulation Lab Utilizing Relay Logic

The ProSim-II Door Simulation

1. From the Simulations Menu at the top of the screen, Select the Door Simulation.
2. Take the time to familiarize yourself with the components used in the Door system, and take
particular note of the current state of the limit switches.
3. When the door is in the closed position, both limit switches are in their activated state (Not Normal).
4. Run your mouse over each switch, and you should see a tool-tip text box appear, which denotes that
the selected switch is wired using a set of Normally Open contacts.
Qn: With the door fully closed, what signal level would you expect to see at the limit switch inputs
I:1/03 and I:1/04?
5. To confirm your assessment of the current limit switch states, place the PLC into the RUN mode
which will initiate scanning.
6. Now open the Data Table display by clicking on the Data Table icon located on the toolbar (3rd
from right) at the top of the screen.
7. When you have the Data Table showing, select the "Input Table" from the drop down Table list box.
You should now be able to see the current state of each bit associated with input card I:1. You should
also note that bit I:1/02 is also in a High or True state.
8. Use your mouse to press the Stop switch on the Control Panel a few times, and note the results.

Note: Don't continue on with the exercise until you are confident that you understand the
rational of the observed results.

7
Student Programming Exercise #1:

In this exercise you are required to apply your knowledge of Relay Logic Instructions to design a program
which will control the ProSim-II Door. The Door System includes a Reversible Motor, a pair of Limit
Switches and a Control Panel, all connected to your PLC. The program you create will monitor and control
this equipment while adhering to the following criteria:

 In this exercise the Open and Close pushbuttons will be used to control the movement of the door.
Movement will not be maintained when either switch is released, and therefore the Stop switch is
neither required nor used in this exercise. However, all other available Inputs and Outputs are
employed in this exercise.
 Pressing the Open Switch will cause the door to move upwards (open) if not already fully open. The
opening operation will continue as long as the switch is held down. If the switch is released, or if
limit switch LS1 opens, the door movement will halt immediately.
 Pressing the Close Switch will cause the door to move down (close) if not already fully closed. The
closing operation will continue as long as the switch is held down. If the switch is released, or if
limit switch LS2 closes, the door movement will halt immediately.
 If the Door is already fully opened, Pressing the Open Switch will Not energize the motor.
 If the Door is already fully closed, Pressing the Close Switch will Not energize the motor.
 Under no circumstance will both motor windings be energized at the same time.
 The Open Lamp will be illuminated if the door is in the Fully Open position.
 The Shut Lamp will be illuminated if the door is in the Fully Closed position.

It is your responsibility to fully design, document, debug, and test your Program. Avoid the use of OTL or
OTU latching instructions, and make a concerted effort to minimize the number of rungs employed. Ensure
that you have made effective use of both instruction and rung comments to clearly document your program.
All I/O components referenced within your program should be clearly labeled, and rung comments should
be employed to add additional clarity as required.

8
Student Programming Exercise #2:

In this exercise we want you to apply your knowledge of Relay Logic Instructions to design a program
which will maintain the appropriate door movement once initiated by the operator. The Opening or Closing
operation of the door will continue to completion even if the operator releases the pushbutton which initiated
the movement. The program will adhere to the following criteria:

 Door movement will halt immediately when the Stop Switch is initially pressed, and will remain
halted if the switch is released.
 Pressing the Open Switch will cause the door to Open if not already fully open. The opening
operation will continue to completion even if the switch is released.
 Pressing the Close Switch will cause the door to Close if not already fully shut. The closing operation
will continue to completion even if the Switch is released.
 If the Door is already fully opened, Pressing the Open Switch will Not energize the motor.
 If the Door is already fully closed, Pressing the Close Switch will Not energize the motor.
 Under no circumstance will both motor windings be energized at the same time.
 The Ajar Lamp will be illuminated if the door is NOT in either the fully closed or fully opened
position.
 The Open Lamp will be illuminated if the door is in the Fully Open position.
 The Shut Lamp will be illuminated if the door is in the Fully Closed position.

It is your responsibility to fully design, document, debug, and test your Program. Avoid the use of OTL or
OTU latching instructions, and make a concerted effort to minimize the number of rungs employed.

As before, ensure that you have made effective use of both instruction and rung comments to clearly
document your program.

9
Student Programming Exercise #3:

This exercise will introduce you to a simple programming technique for adding a bit of "Flash" to your
program. You will make use of the PLC's Free Running.

Timer which can be viewed in the Data Table Display at location S2:4. This integer word contains a count
which is incremented continuously by the PLC when it is in the Run mode, and it can come in quite handy
at times for variety of purposes. In this exercise you are required to utilize this word as follows:

With the PLC in the Run mode, Display word S2:4 utilizing the Data Table display.

Ensure that the Radix is set to Binary so that you can view the individual bits within the word. You should
see a binary count in progress where the rate of change of each bit is directly related to it's position within
the word. Bit 0 will have the highest rate, while Bit 1 will be 1/2 as fast as Bit 0, and Bit 2 half as fast as 1
etc. etc.

We want you to add a Lamp Flasher to your program by monitoring the state of one of these bits with an
XIC instruction. I'm going to suggest using Bit 4 for this purpose, but depending upon the speed of your
computer you may elect to substitute another Bit.

With an actual AB PLC, the rate is consistent, but with LogixPro it varies from computer to computer.

Place an XIC instruction addressed to S:4/4 on the rung which controls either the Open or Shut Lamp in
your previous program. Now download and Run this modified program to see the flashing effect achieved.
The Lamp should flash at a reasonable rate whenever your program energizes the selected Lamp.

Now modify your program so that the following criteria is met:

 If the Door is fully open, the Open lamp will be energized but not flashing as was the case before.
 If the Door is opening, the Open lamp will flash while the door is in motion.
 If the Door is fully closed, the Shut lamp will be energized but not flashing as was the case before.
 If the Door is closing, the Shut lamp will flash while the door is in motion.
 The Ajar Lamp will flash if the door is stationary, and is not in the fully open or fully closed position.
The Ajar Lamp will flash at a slower rate (1/4) then the other lamps.
 The Ajar Lamp will be illuminated in a steady state if the door is in motion.

As before, ensure that you have made effective use of both instruction and rung comments to clearly
document your program.

10
Supplemental Programming Exercise #4:

You are not recommend to proceed with this exercise if you do not have an instructor or experienced PLC
programmer to call upon for assistance.

In this exercise we want you to modify your program so that it adheres to this additional criteria:

 If the door is currently opening, pressing the Close Switch will immediately halt movement. Door
movement will remain halted when the switch is released.
 If the door is currently closing, pressing the Open Switch will immediately halt movement. Door
movement will remain halted when the switch is released.
 Once movement is halted by the either of the foregoing actions, the operating criteria associated with
the previous exercise will again take effect.
 The utilization of Binary or Integer Table bits to Flag specific conditions within your program would
be appropriate. Also, the retentive OTL and OTU instructions may be utilized freely at your
discretion.

11
The Silo Lab Utilizing Relay Logic

Exercise #1 -- Continuous Operation

Completely design and de-bug a ladder control circuit which will automatically position and fill the boxes
which are continuously sequenced along the conveyor. Ensure that the following details are also met:

 The sequence can be stopped and re-started at any time using the panel mounted Stop and Start
switches.
 The RUN light will remain energized as long as the system is operating automatically.
 The RUN light, Conveyor Motor and Solenoid will de-energize whenever the system is halted via
the STOP switch.
 The FILL light will be energized while the box is filling.
 The FULL light will energize when the box is full and will remain that way until the box has moved
clear of the prox-sensor.

Exercise #2 -- Container Filling with Manual Restart


Alter or re-write your program so that it incorporates the following changes:
 Stop the conveyor when the right edge of the box is first sensed by the proxsensor.
 With the box in position and the conveyor stopped, open the solenoid valve and allow the box to fill.
Filling should stop when the Level sensor goes true.
 The FILL light will be energized while the box is filling.
 The FULL light will energize when the box is full and will remain that way until the box has moved
clear of the prox-sensor.
 Once the box is full, momentarily pressing the Start Switch will move the box off the conveyor and
bring a new box into position. Forcing the operator to hold the
 Start button down until the box clears the prox-sensor is not acceptable.

12
Exercise #3 -- Selectable Mode of Operation

Alter or re-write your program so that the panel mounted Selector switch can be utilized to select one of 3
different modes of operation. The 3 modes shall operate as follows:

 When the selector switch is in position "A", the system shall operate in the "Continuous" mode of
operation. This is the mode of operation which was used in Exercise #1.
 When the selector switch is in position "B", the system shall operate in the "Manual Restart" mode
of operation. This is the mode of operation which was used in Exercise #2.
 When the selector switch is in position "C", the system shall operate in the "Fill Bypass" mode of
operation. In this mode, the boxes will simply move down the conveyor continuously and bypass
the fill operation. As in the other modes, the Start and Stop pushbuttons will control the conveyor
motion and the Run Lamp will operate as expected.

13
Introduction To RSLogix Timers

The TON Timer .... (Timer ON Delay)


 From the LogixPro Simulations Menu, select the I/O Simulation.
 Clear out any existing program by selecting the "New" entry in the File menu, and then
select the "Clear Data Table" entry in the Simulations menu.
 Now enter the following program being careful to enter the addresses exactly as shown.
 Confirm that you have entered the number 100 as the timer's preset value. This value
represents a 10 second timing interval (10x0.1) as the timebase is fixed at 0.1 seconds:

Once you have your program entered, and have ensured that it is correct, download it to the PLC.

 Ensure that Switch I:1/0 is Open, and then place the PLC into the Run mode.
 Right click on the Timer instruction, and select "GoTo DataTable" from the drop down menu.
 Note the initial value of timer T4:1's accumulator and preset in the spaces below.

14
Also indicate the state of each of the timer's control bits in the spaces provided:

Initial State (Switch I:1/0=Open):

T4:1.ACC = _____ T4:1.PRE = ______ T4:1/EN = ____ T4:1/TT = ____ T4:1/DN= ____

Final State (Switch I:1/0=Closed):

T4:1.ACC = _____ T4:1.PRE = ______ T4:1/EN = ____ T4:1/TT = ____ T4:1/DN= ____

 Toggle the state of switch I:1/0 a number of times, and observe the operation of the Timer in both
the DataTable display and in the Ladder Rung program display.
 Confirm that when the rung is taken false, the accumulator and all 3 control bits are reset to zero.
This type of timer is a non-retentive instruction, in that the truth of the rung can cause the
accumulator and control bits to be reset (=0).

Conclusions:
Use the TON instruction to turn an output on or off after the timer has been on for a preset time interval.
This output instruction begins timing when its rung goes "true". It waits the specified amount of time (as set
in the PREset), keeps track of the accumulated intervals which have occurred (ACCumulator), and sets the
DN (done) bit when the ACC (accumulated) time equals the PRESET time.
As long as rung conditions remain true, the timer adjusts its accumulated value (ACC) each evaluation until
it reaches the preset value (PRE). The accumulated value is reset when rung conditions go false, regardless
of whether the timer has timed out.

15
Cascaded TON Timers
 Insert a new rung containing a second timer just below the first rung as shown below. This second timer
T4:2 will be enabled when the first timer's Done bit T4:1/DN goes true or high (1).

Once you have completed this addition to your program, download your program to the PLC and
select RUN.
Toggle the state of switch I:1/0 to ON and observe the operation of the timers in your program.
 Bring the DataTable display into view, and pay particular attention to the way in which the
timers are cascaded (one timer starts the next).
 Try changing the value of one of the timer presets by double clicking on the preset value in the
DataTable display, and then entering a new value.
 Run the timers through their timing sequence a number of times.
Don't move on until you are satisfied that the timers are working as you would expect. In this exercise
we have utilized just two timers, but there is nothing stopping us from sequencing as many timers as
we wish. The only thing to remember is; to use the DN (done) bit of the previous timer to enable the
next timer in the sequence. Obviously locating the timers on consecutive rungs, and employing
consecutive numbering will make such a program much easier to read and trouble-shoot.

16
Self Resetting Timers

 Place the PLC into the PGM mode, and modify the first rung of your program as depicted below.

 Once you have modified your program, download it to the PLC and place the PLC into the RUN
mode.
 Close switch I:1/0 and observe the operation of the timers. The timers should now be operating in a
continuous loop with Timer1 starting Timer2, and then when Timer2 is done, Timer1 is reset by
Timer2's done bit. As before, when Timer1 is reset, it in turn resets Timer2 which causes Timer2's
done to go low (T4:2/DN=0). Once Timer2's done bit is low, the sequence is back to where it
originally began, and the timing sequence will start over once again on the very next scan.
 Remove the first instruction (switch XIC I:1/0) from rung zero of your program.
 Download and RUN this modified version of your program
 Does the timing operation continuously sequence as before? It should!
 Can you stop the timing sequence? Not without taking the PLC out of the RUN mode! In many
applications there may never be a need to stop such a timing sequence, so a switch might not be used
or needed.

In this exercise we cascaded two timers, but as before there is nothing to stop us from cascading as many
timers as we wish. The thing to remember here is; utilize the DN (XIC or "NOT"done) bit of the last timer
in the sequence to reset the first timer in the sequence. Once again, consecutive rungs, and numbering will
make a program much easier to read and trouble-shoot.

17
The TOF Timer .... (Timer OFF Delay)

In Allen Bradley PLC programming, the TON timer is by far the most commonly used type of timer. Most
people consider TON timers to be simple to use and understand. In comparison, many people find the
operation of the Allen Bradley TOF (Timer OFF delay) timer to be less intuitive, but I'm going to let you
decide for yourself.

 Make sure that switch I:1/0 is Closed, and then enter or modify your existing program to match the
one shown below.

Once you have your program entered, and have ensured that it is correct, download it to the PLC.

 Ensure that Switch I:1/0 is Closed, and then place the PLC into the Run mode.
 Right click on the Timer instruction, and select "GoTo DataTable" from the dropdown menu.
 Note the initial value of timer T4:1's accumulator and preset in the spaces below. Also indicate the
state of each of the timer's control bits in the spaces provided:
Initial State (Switch I:1/0=Closed):
T4:1.ACC = _____ T4:1.PRE = ______ T4:1/EN = ____ T4:1/TT = ____ T4:1/DN= ____
 Open switch I:1/0, and carefully observe the incrementing of the timer's accumulator, and the state
of each of it's control bits.
 Once the Timer stops incrementing, note the final value of timer T4:1's accumulator, preset, and the
state of it's control bits below:
Final State (Switch I:1/0=Open):
T4:1.ACC = _____ T4:1.PRE = ______ T4:1/EN = ____ T4:1/TT = ____ T4:1/DN= ____
 Toggle the state of switch I:1/0 a number of times, and observe the operation of the Timer in both
the DataTable display and in the Ladder Rung program display.
 Confirm that when the rung is taken true, the accumulator and all 3 control bits are reset to zero. The
TOF timer like the TON timer is also a non-retentive instruction and can be reset by changing the
truth of the rung.

Conclusions:
Use the TOF instruction to turn an output on or off after its rung has been off for a preset time interval. This
output instruction begins timing when its rung goes "false." It waits the specified amount of time (as set in
the PRESET), keeps track of the accumulated intervals which have occurred (ACCUM), and resets the DN
(done) bit when the ACCUM (accumulated) time equals the PRESET time.

The Accumulated value is reset when rung conditions go true regardless of whether the timer has timed out.

18
The RTO Timer .... (Retentive Timer ON)

 Make sure that switch I:1/0 is Open, and then replace the TOF timer in your program with a RTO
retentive timer.
 Now insert a new rung below the timer, and add the XIC,I:1/1 and RES,T4:1 instructions.
 Your program should now match the one shown below:

Once you have your program entered, and have ensured that it is correct, download it to the PLC.

 Ensure that both Switches are Open, and then place the PLC into the Run mode.
 Right click on the Timer instruction, and select "GoTo DataTable" from the dropdown menu.
 Note the initial value of timer T4:1's accumulator, preset and control bits. Are we starting off with
the same values we had in the TON exercise? You should be answering Yes.!
 Close switch I:1/0 for 2 or 3 seconds and then Open it again.
 Note that the timer stopped timing when the rung went false, but the accumulator was not reset to
zero.
 Close the switch again and leave it closed which will allow the timer to time-out (ACC=PRE).
 Once timed out, note the state of the control bits
 Open the switch, and once again note the state of the control bits.
 Now close Switch I:1/1 and leave it closed. This will cause the Reset instruction to go true.
 Close switch I:1/0 momentarily to see if the timer will start timing again. It should not!
 Open Switch I:1/1 which will cause the Reset instruction return to false.
 Now toggle switch I:1/0 several times and note that the timer should again start timing as expected
 Repeat the foregoing steps, until you are satisfied that you clearly understand the operation of both
the RTO timer, and the Reset instruction.

Conclusion
An RTO timer functions the same as a TON with the exception that once it has begun timing, it holds its
count of time even if the rung goes false, a fault occurs, the mode changes from RUN to PGM, or power is
lost. When rung continuity returns (rung goes true again), the RTO begins timing from the accumulated
time which was held when rung continuity was lost. By retaining its accumulated value, retentive timers
measure the cumulative period during which rung conditions are true.

19
Traffic Control Lab Utilizing TON Timers

Exercise #1 -- Traffic Control using 3 Lights

Using your knowledge of cascading timers, develop a ladder logic program which will sequence a set of
green, amber and red lights in the following manner:

Sequence of Operation:

1. Light O:2/00 (Red) = 12 seconds ON

2. Light O:2/02 (Green) = 8 seconds ON

3. Light O:2/01 (Amber) = 4 seconds ON

4. The sequence now repeats with Red = ON.

<----------------- Time in Seconds ------------------>

20
Exercise #2 -- Traffic Control using 6 Lights

Modify your program so that the 3 lights which represent the other traffic direction are also controlled. It is
tempting to use six Timers for this task, but the job can be done with just four, and you'll end up with a
much cleaner program as a bonus.

Still getting the odd Crash? Well it's pretty obvious that these drivers aren't paying much attention to Amber
Lights! No need for any more wiring however. You can solve this problem, but it's going take a little more
programming.

Exercise #3 -- Traffic Light With Delayed Green

Modify your program so that there is a 1 second period when both directions will have their RED lights
illuminated. Note that the timing diagram below only shows one of these

1 second intervals but two are actually required. Work the problem out, and try to keep the Timer countdown
to six.

If a one second delay is not enough to get these drivers under control then just go ahead and jack the delay
up to two!

21
Introduction To Word Compare Instructions
The RSLogix basic Comparison Instructions

 From the LogixPro Simulations Menu, select the I/O Simulation.


 Clear out any existing program by selecting the "New" entry in the File menu, and then select the
"Clear Data Table" entry in the Simulations menu.
 Now enter the following program being careful to enter the addresses and values exactly as shown.

22
Once you have completed entering your program, download your program to the PLC.

 Ensure that SW0 and SW! are configured as Normally Open pushbuttons then place the PLC into
the Run mode.
 Toggle the state of switch SW0 (I:1/0) continuously while observing the truth of each of rungs as
indicated by the lamps.
 Once the count exceeds nine or ten, reset the counter and repeat the above sequence. Keep doing
this until you are convinced that the instructions are operating as described in the RSLogix
documentation.
 Finally, indicate the observed state of the lamps, by circling the appropriate numbers below:

Lamp 0 is On during counts: 1...2...3...4...5...6...7...8...9...10

Lamp 1 is On during counts: 1...2...3...4...5...6...7...8...9...10

Lamp 2 is On during counts: 1...2...3...4...5...6...7...8...9...10

Lamp 3 is On during counts: 1...2...3...4...5...6...7...8...9...10

Conclusions:

The basic Comparison instructions compare the values stored in two memory locations.
These two values can be the data stored in two different word locations, or one can be the data stored
in a word and the other can be a constant value. The basic comparison instructions are:

 EQU: The Equal instruction goes true if the source A and B values are Equal to each other
 NEQ: The Not Equal instruction goes true if the source A and B values are Not Equal to each other
 LES: The Less Than instruction goes true if the value in source A is Less Than the value in source B
 GRT: The Greater Than instruction goes true if the value in source A is Greater Than the value in
source B
 LEQ: The Less Than OR Equal instruction goes true if the value in source A is Less Than or Equal
to the value in source B
 GEQ: The Greater Than OR Equal instruction goes true if the value in source A is Greater Than or
Equal to the value in source B

Since any PLC word including Timer and Counter accumulators and presets can be used as the source
value in any of the basic comparison instructions, these instructions prove extremely versatile and are
widely used in RSLogix programs.

23
The LIM Instruction .... Limit Comparison

 Modify or rewrite your existing program so that the first 3 rungs appear as shown below.
 Ensure that addresses and values are exactly as shown.

Once you have completed modifying your program, download your program and place the PLC
into the Run mode.

 Toggle the state of switch SW0 (I:1/0) continuously while observing the truth of Lamp 4.
 Once the count exceeds ten, reset the counter and repeat the above sequence. Keep doing
this until you are convinced that the LIM instruction is operating as described in the
RSLogix documentation.
 Finally, indicate the observed state of Lamp 4, by circling the appropriate numbers below:

Lamp 4 is On during counts: 1...2...3...4...5...6...7...8...9...10

Conclusions:

The LIM (Limit Comparison) instruction compares the Test value to the value of the Low Limit and
the value of the High Limit. The instruction goes true if .. Test is Equal to or Greater than the Low
Limit .. And .. Test is Less Than or Equal to the High Limit. A logical equivalent to rung 2 is shown
below:

The LIM instruction provides in a single package the same functionality that would normally necessitate
the utilization of 2 basic comparison instructions.

24
The MEQ Instruction .... Masked, Equal Comparison

The MEQ instruction is sometimes considered an advanced level instruction which many might deem
inappropriate for inclusion in a basic level exercise. The MEQ is however listed with the other comparison
instructions, so a quick peek at it's functionality should not cause major harm. The subject of "Masking"
relates to the act of controlling which bits within a binary value or word are passed through to a destination.

The following program is a very simple demonstration of how extraneous information can be selectively
ignored with the judicious use of masking. There are several other instructions in the RSLogix instruction
set that employ masking and work similarly, but only the MEQ instruction will be reviewed here.

 Clear your existing program by selecting the "New" entry in the File menu.
 Now enter the following program being careful to enter the addresses and values exactly as shown.
 Note: address I:5 is the address of the I/O simulator's input card which has the thumbwheel switches
connected to it.

The MEQ and EQU instructions are almost identical in operation. The only difference is that with the MEQ
instruction, selected bits within the Source value can be "masked out" or deleted prior to doing the
comparison for Equality. In the above MEQ example we are going to mask out all bits other than the 4
which contain the data from the first thumbwheel switch.

 Once you have completed your program, download your program and place the PLC into the Run
mode.
 Starting with the right hand (units) thumbwheel only, increment the displayed value up and down and
note how both lamps energize when the value is set to 4.

Now set the first thumbwheel to 4 and start incrementing the second (tens) thumbwheel. If your program
is operating correctly only lamp 6 should remain lighted.
z Finally, set the thumbwheel values to match those listed below, and circle the appropriate number if the
corresponding lamp is On.

 Lamp 5 is On when the thumbwheel value is: 1...4...14...34...54...94...104


 Lamp 6 is On when the thumbwheel value is: 1...4...14...34...54...94...104

25
Conclusions:
The MEQ instruction has the same functionality of an EQU instruction, but it allows you to first
mask out any extraneous information or bits prior to doing the actual test for equality.

Advanced level? Not really, but it does require a reasonably good understanding of numbering
systems and in particular binary.

26
Traffic Control Lab Utilizing Word Comparison

Exercise #1 -- Traffic Control utilizing 1 Timer

1. From the Simulations Menu at the top of the LogixPro screen, select the Traffic Light Simulation
2. Utilizing a single timer, employ the use of Word Comparison instructions to control our simulated traffic
light. The sequence of operation and timing durations are set out in following timing diagram.

Your program should incorporate a 1 second period (delayed green) when both directions will have only
their RED lights illuminated. Note that the timing diagram below only shows one of these 1 second
intervals, but two are actually required.

If a one second delay proves insufficient to get these drivers under control then just go ahead and jack
the delay up to two!

27
Exercise #2 -- Dealing with Pedestrians

Modify your program so that the crosswalks are also controlled. This is not necessarily a word comparison
exercise, but it's a task that needs doing, and you should now have sufficient expertise to accomplish it. It
might not be all that easy however!

Your program should operate as follows:

 When depressed, the crosswalk pushbutton will cause the appropriate Walk Sign to be illuminated
at the next occurrence of a Red to Green transition for the appropriate direction.
 If the Green light is already illuminated when the button is pressed then the Walk signal sequence
will be delayed until the next Red to Green transition occurs.
 Once the Walk Sign is illuminated, it will remain so for the duration of the Green signal.
 When the Amber light appears, the Walk Sign will commence to flash On and Off and continue to
do so until the Red signal appears.

You might consider using a bit from the free-running timer located in S2:4 to create the cautionary
flashing effect.

28
Introduction To RSLogix Counters
(A) The CTU and RES...... Counter Instructions
1. From the LogixPro Simulations Menu, select the I/O Simulation.
2. Clear out any existing program by selecting the "New" entry in the File menu, and then select the "Clear
Data Table" entry in the Simulations menu.
3. Now enter the following program being careful to enter the addresses exactly as shown.
4. Confirm that you have entered the number 10 as the counter's preset value. This value is optionally used
to set the point at which the counter's Done Bit will be Set, indicating that the count is complete.

5. Once you have your program entered, and have ensured that it is correct, download it to the PLC.
6. Ensure that Switch I:1/0 and I:1/1 are Open, and then place the PLC into the Run mode.
7. Right click on the CTU instruction, and select "GoTo DataTable" from the dropdown menu.
8. Note the initial value of Counter C5:1's accumulator and preset in the spaces below. Also indicate the
state of each of the Counter's primary control bits in the spaces provided:

Initial State (Switch I:1/0=Open):

C5:1.ACC = _______ C5:1.PRE = _______ C5:1/CU = ___ C5:1/CD = ___C5:1/DN = ___

29
9. Open and Close switch I:1/00 a number of times and carefully observe the incrementing of C5:1's
accumulator and the operation of the enable and done bits.
10. Close switch I:1/01 and observe the effect that the "RES" instruction has on the counter.
11. Attempt to increment the counter while switch I:1/01 is closed. You should not be able to increment the
counter while the "RES" instruction is held "True".
12. Open switch I:1/01 to allow the "RES" instruction to go false, and then increment the counter until the
accumulator matches the preset.
13. Increment the counter 2 or 3 more times and note the final value of C5:1's accumulator, preset and status
bits in the spaces below.

Final State (Switch I:1/0=Closed):

C5:1.ACC = _______ C5:1.PRE = _______ C5:1/CU = ___ C5:1/CD = ___C5:1/DN = ___

Conclusions:

The CTU output instruction counts up for each false-to-true transition of conditions preceding it in the rung
and produces an output (DN) when the accumulated value reaches the preset value. Rung transitions might
be triggered by a limit switch or by parts traveling past a detector etc.

The ability of the counter to detect a false-to-true transitions depends on the speed (frequency) of the
incoming signal. The on and off duration of an incoming signal must not be faster than the scan time.

Each count (accumulator) is retained when the rung conditions again become false, permitting counting to
continue beyond the preset value. This way you can base an output on the preset but continue counting to
keep track of inventory/parts, etc.

Use a RES (reset) instruction with the same address as the counter, or another instruction in your program
to overwrite the value of the accumulator and control bits.

The on or off status of counter done, overflow, and underflow bits is retentive. The accumulated value and
control bits are reset when a RES is enabled.

30
(B) The CTD...... Count Down Instruction

Ensure that switch I:1/00 and I:1/01 are open; then place the PLC into the Program mode, and Insert a new
rung containing a CTD instruction just below the first rung in your program.

1. Once you have completed this addition to your program, download your program to the PLC and
select RUN.
2. Toggle the state of switch I:1/0 continuously until the accumulator of C5:1exceeds the preset.
3. Now toggle switch I:1/02 and decrement counter C5:1 while carefully observing the status bits of the
counter. Increment and decrement the counter from below zero to beyond the preset a number of
times.

Conclusions:

The CTD output instruction counts down for each false-to-true transition of conditions preceding it in the
rung and produces an output when the accumulated value reaches the preset value. Rung transitions might
be triggered by a limit switch or by parts traveling past a detector.

Each count is retained when the rung conditions again become false. The count is retained until a RES
(reset) instruction with the same address as the counter is enabled, or if another instruction in your program
overwrites the value.

The accumulated value is retained after the CTU or CTD instruction goes false, and when power is removed
from and then restored to the processor. Also, the on or off status of counter done, overflow, and underflow
bits is retentive. The accumulated value and control bits are reset when a RES is enabled.

31
(C) Applying Counter Instructions.... An Up/Down Sequence Example

1. Ensure that the I/O Simulation is still selected.


2. Clear your existing program by selecting the "New" entry in the File menu, and then select the "Clear
Data Table" entry in the Simulations menu.
3. Note the use of the "EQU" instruction in rung 2 of the following program. This input instruction will
go true if the value referenced by the Source entry is "Equal" to the value contained in the Source B
entry. In this example, the instruction will go true if the accumulator of the counter is equal to zero.
4. Now enter the following program being careful to enter the addresses exactly as shown.

5. Once you have your program entered, and have ensured that it is correct, download it to the PLC.
6. Confirm that you have configured switch I:1/0 as a N.O. pushbutton then place the PLC into the
"Run" mode.
7. Continuously Open and Close switch I:1/00 while carefully observing the incrementing of C5:1's
accumulator.
8. If you have entered your program correctly, the accumulator should increment until the count of 10
is reached, and then start to decrement. When the count reaches zero, the B3:1/0 flag bit should be
cleared and the up/down sequence should then repeat.
9. Ensure that your program is operating as described, and carefully note how bit B3:1/0 is being
employed to track and control the direction of the counting sequence.
10. Note the conditions that must be present in order for bit B3:1/0 to be latched On. The first XIC
instruction ensures that the latching only occurs when the pushbutton switch is released

32
11. Delete this XIC instruction from rung 1, and then download and run your program again.
12. Without the XIC instruction, the latching will occur as soon as the count of ten is reached and the
CTD instruction will immediately decrement the counter back to a count of 9.
13. Set the scan speed to it's lowest value, and you should be able to see that the count does reach 10,
but it is then immediately decremented.

Conclusions:

The CTU is by far the most commonly used counter instruction. It can, and is utilized in almost a limitless
number of counting applications, and is typically very easy to understand and employ.

The CTD instruction is less widely employed. It is extremely useful however when paired with a CTU,
where up/down counting operations are required. Cars entering and leaving a parking lot, containers being
filled and then emptied are just 2 examples of where paired CTU/CTD counters might be employed.

The elegance of the CTU/CTD pairing can extract a price however in terms of ease of use and program
clarity. As the last exercise highlighted, one requires a very clear understanding of the operation of these
instructions and the PLC's scan sequence, in order to employ them effectively.

This last exercise was definitely not the only way to setup an up/down counting sequence, but it does
highlight the attention to detail that you will need to demonstrate when tackling the later sections of the next
student exercise.

33
The Batch Mix Lab Utilizing PLC Counters

Exercise #1 -- Filling the Batch Mixing Tank

From the Simulations Menu at the top of the screen, Select the Batch Mixing Simulation.

Using your knowledge of PLC counters, design a program to meet the following requirements:

1. When the Start switch (I:1/0) is pressed, pump P1 will be energized and the tank will start to fill.
The pulses generated by Flow meter 1 should be used to increment a counter.
2. When the count reaches a value where the tank is approximately 90% full, the pump is to be shut-
off and the control panels FULL light is to be energized.
3. The filling operation is to halt immediately if the stop switch is pressed.
4. While testing, utilize the "Reset Simulation" and the "Reset Timers and Counters" entries in the
Simulations menu to re-start your program.

To make it a little easier to see what is happening with the counter, you might want to add the following
rung to the end of your program.

If correctly entered, the TOD (To BCD) instruction will take the integer value in the counters accumulator,
convert it to Binary Coded Decimal, and then move (copy) this BCD value to the control panel LED display
(O:4). The TOD instruction can be located in the Compute/Math group of instructions in the Edit Panel. Be
sure to alter the Source entry to match the counter number you are using.

34
Exercise #2 -- Emptying the Batch Mix Tank

Modify your program so that it meets the following additional requirements:

 The mixer will run for 8 seconds once the tank is full.
 When the mixing is complete, drain pump P3 is to be started and the tank is to be drained. Flowmeter
3 will be employed to decrement the existing counter, and draining will be allowed to continue till
the counters accumulator reaches zero.
 Once the tank is empty again, pressing the Start switch will cause the sequence to repeat.

Exercise #3 -- Continuous Operation

Modify your program so that the filling and emptying sequence will repeat continuously once it has been
started by the initial pressing of the Start switch.

 Ensure that the RUN light is energized when the mixer or either pump is running.
 The STANDBY light should light and the process should halt when the Stop button is pressed.
 The process should restart where it left off if the Start button is pressed following a Stop.

35
The Advanced Batch Mixing Lab

A Programmable Batch Mixing System

Exercise #1 -- Single Batch Mode of Operation

Using your knowledge of PLCs, design a program to meet the following criteria:

 When the 3 position Selector Switch is in position "A". the batch mixing process will run in a single
batch mode. The operator may start the batch mix sequence by momentarily pressing the Start Switch.
 Once a batch sequence has begun, the sequence may be stopped and resumed at any time using the Stop
and Start switches.
 The tank is to be filled with a mixture obtained from the separate fill lines utilizing fill pumps P1 and
P2. A counter will track the quantity of product obtained from Line 1 (P1) while the remainder will
come from Line 2 (P2). The mixture ratio of the product will be controllable by adjusting the counter's
preset. The tank is to be filled to the point where the Hi-Level sensor goes true.
 When filling is complete, the Full light will turn On. Heater O:2/04 and Mixer O:2/00 will be started
allowing the mixture to begin heating. Thermostat I:1/02 will be employed to control the temperature.
 The mixer will continue to run for 4 seconds after the mixture reaches the desired temperature. When
the mixer stops, pump P3 will be used to drain the product from the tank. The tank will be drained to
the point where the Lo-Level sensor trips.
 Once emptied, a new single batch sequence may again be started by pressing the Start Switch while the
Selector switch is in position "A".

Exercise #2 -- Multiple Batch Mode of Operation

Enhance your program to include the following features:

 When the 3 position Selector Switch is in position "B". the process will produce multiple batches, The
number of batches produced will be operator selectable, and the current batch count will be displayed
on the Control panel's LED display.
 The operator will be able to enter the desired batch count using the control panel thumbwheel switches.
 The operator will be able to set the product ratio by entering the desired product one percentage via the
control panel thumbwheel switches.

It is your responsibility to make the operator interface as simple and fault tolerant as possible.

36

You might also like