beginner’s guide to plc programming [neal babcock] 2008

Upload: winkyaw333

Post on 28-Feb-2018

221 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    1/77

    Beginners Guide

    to

    PLCProgramming

    How to Program a PLC (Programmable Logic Controller)

    By Neal Babcock

    modernmediaonline.com

    Copyright 2008 Modern Media

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    2/77

    Table of ContentsIntroduction to PLCs.....................................................................................................................3Ladder Logic.................................................................................................................................3The Dialect of PLCs .....................................................................................................................5Equivalent Logic ...........................................................................................................................7

    Scan Time ....................................................................................................................................9The Automated Drill Press..........................................................................................................10Sequence of Operation...............................................................................................................11Operator Station.........................................................................................................................13I/O Listing ...................................................................................................................................14

    Inputs......................................................................................................................................14Outputs ...................................................................................................................................15Internal Coils...........................................................................................................................15

    The Program ..............................................................................................................................16Machine Safeties ....................................................................................................................16Pilot Light Test ........................................................................................................................18

    Indicate The System Is Operational........................................................................................19Machine Operation Mode........................................................................................................19Run The Spindle Drive Motor..................................................................................................20Indicate The Spindle Drive Is Running....................................................................................20Run The Infeed Conveyor.......................................................................................................21Ensure There Are No Parts In The Machine ...........................................................................21Ensure All Components Are At Home.....................................................................................22Begin The Cycle .....................................................................................................................22Lower The Stop Gate..............................................................................................................23Run The Main Conveyor .........................................................................................................23Indicate The Part Is In Place...................................................................................................24Clamp The Part In Place.........................................................................................................24Lower The Spindle..................................................................................................................25Drilling Operation Is Complete................................................................................................26Return The Spindle To Its Home Position...............................................................................27Machine Cycle Is Complete ....................................................................................................28Fault Detection And System Diagnostics................................................................................29Personnel Safety Guard Door.................................................................................................29Low Compressed Air Pressure ...............................................................................................30Motor Starter Overload ...........................................................................................................31Latch The Motor Overload Detection ......................................................................................32Indicate A Motor Overload Condition......................................................................................32Jammed Part Detection ..........................................................................................................33Latch The Part Jammed Detection .........................................................................................34Indicate A Part Jammed Condition .........................................................................................34Monitor The Drill Time.............................................................................................................35Summarize The Fault Conditions............................................................................................36

    13 Marks Of A Well Written Program .........................................................................................37General PLC Tips.......................................................................................................................38The Automated Drill Press in Rockwell Automations RSLogix 500 ...........................................39

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    2

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    3/77

    Introduction to PLCs

    Nearly all the industrial equipment that you find in a modern manufacturing facility shares onething in common - computer control. The most commonly used controller is the PLC, or theProgrammable Logic Controller, using a programming language called Ladder Logic. Thelanguage was developed to make programming easy for people who already understood howswitches, relay contacts and coils work. Its format is similar to the electrical style of drawingknown as the ladder diagram.

    Originally, there were only a few functions available in this language, but as times haveprogressed, many more higher-level functions have been introduced. We are going to stick tothe basic, commonly used functions here. Also, this text will not replace the user's manual thatcomes with a PLC, but it will give you a big head start if you have never programmed a PLC.

    This course is intended to provide an introduction to the programming methods used in PLCsand give the reader a solid, basic understanding of the language of Ladder Logic.

    After you complete this course, you may be interested in learning about hardware-specificsoftware and programming techniques. Modern Media offers a book entitled PLC ProgrammingTechniques How to Program an Allen-Bradley SLC 500 with Rockwell Automations RSLogix.This ebook shows, step-by-step, how to create a program from scratch in Allen-BradleysRSLogix 500. To learn more, please visit http://www.modernmediaonline.com.

    Ladder Logic

    I have summarized the terms and techniques you need to know if you are going to work withladder logic. It is not a comprehensive summary, as that would take volumes of text, but if youare just starting out, the information in this book will be very helpful. Every PLC programmer, nomatter what skill level, must have learned the principles described in this book at one point intime. There is simply no way around it.

    I have included a program for a simple machine that lets you really understand how LadderLogic works.

    To effectively write a program, or even edit one, the programmer must know how to visualize theeffects of the changes he will make. In other words, you have to be able to look at the logic onpaper and imagine how it will work when it is entered into the PLC. This course will teach youhow to do that.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    3

    http://www.modernmedia.us/http://www.modernmedia.us/
  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    4/77

    There are many types of PLCs, and differences among PLCs, but what is discussed here shouldbe common to all types. After you read and understand this, you will have a clear understandingof the structure of this type of programming. In the real world of industrial automation, themethods presented in this document may be all that many people will ever need to know.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    4

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    5/77

    The Dialect of PLCs

    Lets' define some terms and symbols:

    BIT- an address within the PLC. It can be an input, output or internal coil, among others.

    RUNG- A section of the PLC ladder program that terminates in an output function of some type.

    HARDWIRED INPUT- a physical connection to the PLC from an input device (switch or sensor,etc.)

    A hardwired input is labeled INPUT in our example.

    HARDWIRED OUTPUT- a physical connection from the PLC to an output device (relay or pilotlight, etc.)

    A hardwired output is labeled OUTPUT in our example.

    INTERNAL COILThis is a programmable bit used to simulate a relay within the PLC. The internal coil has noconnection to the outside world. It does not connect to an output card. Internal coils are used tostore information. The contacts of this relay can then be used multiple times in other parts ofthe program.

    An internal coil is labeled COIL in our example.

    --] [--

    Normally Open ContactWhen used with a hardwired input, this instruction is off until there is a voltage applied to theinput. The bit address then goes high, or on, and the instruction becomes true. It works thesame way when it has the same address as an internal coil, except that the coil must be turnedon by logic in the program.

    --]/[-- Normally Closed ContactThis is an inverted normally open contact. When used with a hardwired input, this instruction is"true" until there is a voltage applied to the input. It then goes low, or off, and becomes false. Italso can be used with an internal coil, becoming true when the coil is off and becoming falsewhen the coil is on.

    -( )- Output CoilWhen used with a hardwired output, this function is off until the logic in the program allows it toturn on. It then becomes true, and will energize the device that is wired to the respectiveoutput. If it is used as an internal coil, it will toggle the instructions associated with it. That is, itwill close a normally open instruction and open a normally closed instruction.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    5

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    6/77

    +---------+TIMER |+-- SEC---+ TimerThis function is used to supply a programmable delay. It requires the use of its "timer finished"bit, like a time delay relay uses its contact.

    +---------+COUNTER |+-- 000---+ CounterThe counter function is used to count events. It could be used to keep track of machine cycles,count parts, etc. It can be programmed with a preset value that triggers another event when thecount is reached.

    TRUE - An indication the a bit is on. If you press a pushbutton switch that is wired to an input,

    then the bit is said to be true. Also, if the logic in a rung turns on the output of the rung, then therung is said to be true.

    FALSE- Without stating the obvious, this is the opposite of true.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    6

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    7/77

    Equivalent Logic

    In its elementary form, PLC logic is very similar to the hard-wired logic you would find in anelectrical ladder diagram.

    For example, if you wanted to turn on a light with a momentary pushbutton, you would wire it likethe circuit below.

    When you press PB1, the pilot light PL1 lights up.

    Now let's do the same thing in a PLC. To duplicate the hardwired circuit on a PLC, you wouldwire the switch PB1 to an input and wire the light PL1 to an output. Each PLC manufacturergives you the details of wiring their particular modules. The I/O (hardwired inputs and outputs) isset up like this:

    - There is a PB1 pushbutton switch wired to INPUT1 of the PLC.- There is a PL1 pilot light wired to OUTPUT1 of the PLC.

    | PB1 PL1| INPUT1 OUTPUT1[---] [------------------------------------------------------( OUT )|

    Now lets examine the sequence of events. When you first turn on the PLC, the PB1 pushbuttonis off, or false. Therefore, the PL1 output is off. Pressing PB1 will make INPUT1 true,

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    7

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    8/77

    OUTPUT1 will come on and the light will be energized. It will stay on only as long as you holdthe button in. Just like electrical current has to flow through the switch to turn on the light in thehardwired circuit, the logic has to "flow" through the normally open instruction (which is closedwhen you press the switch) of INPUT1 to energize the output that turns on PL1.

    The programming terminal display will look something like this as you hold in PB1. The yellowhighlight indicates the bit, or address, is on or true.

    | PB1 PL1| INPUT1 OUTPUT1[---] [------------------------------------------------------( OUT )|

    Let's look at how a timer works. Suppose you want to delay running a motor for 2 seconds afteryou turn on a switch. You can use the input from the switch to run a timer. Program the timer for

    the duration you want and then use the "timer finished" bit to turn on your motor. In thisinstance, we have configured an "on delay" timing sequence. Two seconds after INPUT1 is on,the TIMER1 will turn on its "finished" bit and the motor will run.

    Note that there is no "off delay" here. As soon as the start switch is released, the "timer finished"bit will drop out and the motor will stop. With a little creativity, you can combine timers to provideany timing function you need.

    |Start +--Motor -+|Motor | Start ||PB1 | Delay |

    |INPUT1 TIMER1 |[---] [---------------------------------------------------+--2SEC------+|||Motor|Start Run|Delay Motor|TIMER1 OUTPUT1 [---] [-------------------------------------------------------( OUT )

    One nice feature of PLCs is that you can document each bit in the program. In the exampleabove, INPUT1 is somewhat meaningless on its own. After you add the descriptive text StartMotor PB1, things make more sense.

    Most PLCs are programmed via a Windows based terminal. Editing, deleting or adding to theladder logic is usually pretty straightforward. You use the arrow keys or the mouse to addinstructions, change addresses or comments, etc. We wont cover the specifics of keystrokeshere, but will concentrate on understanding the ladder logic.

    These terminals will usually have the capability of programming online or offline. If you aremaking changes in online mode, be aware that any changes you make and save (or upload) will

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    8

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    9/77

    alter the program that is being used to run the machine. This requires great care and a fullunderstanding of what will happen when you make the change.

    Scan TimeOne critical difference between a PLC program and the equivalent electrical circuit is the issueof scanning. It works like this in most PLCs:

    The PLC looks at the state of the inputs and stores that information in a temporary buffer. Then,it ignores what is happening electrically at the inputs. The PLC will use the information in thetemporary buffer to execute the logic in the program. It will solve the logic from top to bottom,determining the truth of each rung, and turn on or turn off the appropriate addresses in thetemporary buffer. When it reaches the last rung in the program, the PLC will use the data in thetemporary buffer to turn on or turn off the corresponding outputs. The scan cycle is complete,

    and the PLC will once again look at the inputs. The amount of time this takes is called scantime, and is measured in milliseconds.

    Stated more simply, the PLC reads the inputs, performs the logic and adjusts the outputs asneeded.

    In some newer PLCs, such as Rockwells ControlLogix platform, it doesnt work that way. Theinputs are updated during the program scan. In high-speed applications, such as bottling orpharmaceutical lines, this can cause problems.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    9

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    10/77

    The Automated Drill Press

    Now lets jump right into a project. The best way to learn a programming language is to look at areal world example. However, before you can do any programming, you must have a clearunderstanding of how the machine works. Lets say a furniture manufacturer needs to drill a 3/8hole in a certain spot on a piece of wood. The entire process needs to be automatic. Themechanical and electrical engineers bring you an isometric drawing like the one shown here.Mechanical details have been omitted for clarity, as is often the case in a concept drawing.

    The main conveyor will transport the part into the machine where the part will meet apneumatically actuated stop gate. At that time, another pneumatic cylinder will actuate a clampthat will push the part back against the conveyor wall. This will hold the part in place during thedrilling process. Photocells will verify that the part is in position; the spindle will lower andproceed to drill a hole in the part. After the hole has been drilled and the spindle has retracted to

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    10

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    11/77

    its home position, the clamp will release, the stop gate will raise and the part will exit. The cyclethen repeats itself for each part that comes down the line.

    Sequence of Operation

    Here is a more detailed explanation of the drilling process:

    When the machine starts, the stop gate lowersand the part is moved into position by the mainconveyor.

    Optical sensors (photoeyes) determine whenthe part is in place.

    When the part is positioned correctly, a clampextends to hold the part in place.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    11

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    12/77

    The spindle of the drill press is lowered, andthe hole is drilled in the part.

    A sensor in the drill press spindle tells the PLC

    when the spindle has reached the end of itstravel.

    After the hole is drilled, the spindle retracts,the clamp retracts, the stop gate is lifted andthe part is carried out of the machine by themain conveyor.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    12

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    13/77

    Operator Station

    An operator station for the machine might look like this. Though the device name, such as PB1,would not show up on the actual station, it is a good idea to show them on your drawing.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    13

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    14/77

    I/O Listing

    It is important to define the I/O (inputs/outputs) before you begin to program. Do not skip thiscrucial step. Listed below is the I/O arrangement for the Automated Drill Press program.

    InputsAddress Device Name Device Type DescriptionINPUT1 PB1 pushbutton switch Reset SystemINPUT2 PB2 pushbutton switch Start SystemINPUT3 PB3 pushbutton switch Stop SystemINPUT4 SS4 selector switch System in Auto ModeINPUT5 CR1 relay Emergency Stop ClearedINPUT6 PB6 pushbutton switch Start PressINPUT7 PB7 pushbutton switch Stop Press

    INPUT10 PB10 pushbutton switch Raise SpindleINPUT11 PB11 pushbutton switch Lower SpindleINPUT12 PB12 pushbutton switch Hold Part In PlaceINPUT20 MS1AUX aux contacts on motor starter Infeed Conveyor RunningINPUT23 MS2AUX aux contacts on motor starter Main Conveyor RunningINPUT24 MS5AUX aux contacts on motor starter Drill Press RunningINPUT26 LS26 limit switch Guard in PlaceINPUT27 PS27 air pressure switch Air Pressure NormalINPUT31 PSC31 photo-electric switch Placed in X-AxisINPUT32 PSC32 photo-electric switch Placed in Y-AxisINPUT33 PSC33 photo-electric switch Part at Home

    INPUT34 PSC34 photo-electric switch Part ClearedINPUT35 PRS35 proximity switch Spindle RaisedINPUT36 PRS36 proximity switch Spindle Lowered

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    14

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    15/77

    OutputsAddress Device Name Device Type DescriptionOUTPUT1 MS1 motor starter Run Infeed ConveyorOUTPUT2 MS2 motor starter Run Main Conveyor

    OUTPUT5 MS5 motor starter Run Drill PressOUTPUT6 DRV1 variable speed drive Raise SpindleOUTPUT7 DRV1 variable speed drive Lower SpindleOUTPUT11 SOL11 solenoid Hold Part in PlaceOUTPUT12 SOL12 solenoid Lower Drilling Stop GateOUTPUT20 PL20 pilot light System RunningOUTPUT21 PL21 pilot light Drill Press RunningOUTPUT22 PL22 pilot light Part in PlaceOUTPUT23 PL23 pilot light Part JammedOUTPUT24 PL24 pilot light Motor Overload DetectedOUTPUT25 PL25 pilot light Guard Open

    OUTPUT26 PL26 pilot light Low Air Pressure

    Internal CoilsAddress DescriptionCOIL1 System RunningCOIL2 Pilot Light TestCOIL4 System in Auto ModeCOIL5 System in Manual ModeCOIL20 No Part In MachineCOIL21 Machine at HomeCOIL22 Machine in CycleCOIL23 Drilling Operation CompleteCOIL24 End of Machine CycleCOIL34 Part Jam DetectedCOIL35 Excessive Drill Time DetectedCOIL40 Motor Overload DetectedCOIL50 System Fault

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    15

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    16/77

    The Program

    Now that you understand what has to be done and how it is to be accomplished by themechanical equipment, you can begin writing the program.

    The text in the fixed fontis basically the information that you would see if you were lookingat the monitor of the computer or a printout. In actual practice, the fonts used in PLC softwarevary widely. For the purposes of this book, we want to easily differentiate the program logic fromour explanations of the logic.

    A series of asterisks (*****)indicates a "rung comment." This is descriptive text added to theprogram, and is seen on the programming monitor, but has no affect on the logic. For purposesof this manual, I have placed additional explanations between rungs.

    Use a title to name the program and include any general information.

    | ____________________________________________________________| | || | AUTOMATIC DRILL PRESS MACHINE CONTROL || | PRODUCTION LINE #3 || | REVISION 2 || |__________________________________________________________|

    Machine Safeties

    It is best to start a program by evaluating any safety switches and setting a master bit. This typeof bit is what we call an internal coil. It has no hardwired connection to the outside world. In thiscase, a latch is used to set an internal System Running bit. The latch is accomplished byputting a normally open contact around the Start System pushbutton input.

    If the emergency stop is clear, and the machine guard is in place, and there is no system faultthe operator may press the start button to set the latch. If the stop button is pushed or aprevious conditions ceases to exist, the System Running latch will drop out.

    Most of the time, the order of the bits in a rung doesn't matter. We could have rearranged any ofthe bits in this rung, though we would still have to put the latch around the Start pushbutton. The

    PLC wouldn't care and the output coil would still respond the same. However, to make the rungeasier to read, I try to place bits from left to right in order of importance. If the E-Stop is notcleared, then nothing else should matter anyway. Having the safety guard in place is moreimportant than a system fault. Now, if those requirements have been met, we can press the startbutton. And we don't care about the stop button until we have pushed the start button.

    Note the instruction used for the input of PB3, the Stop System bit. It may seem backwards atfirst, since a hard-wired circuit would use the normally closed contacts of the switch. In fact, the

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    16

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    17/77

    switch is wired in the failsafe position, using the normally closed contacts as the input to thePLC.

    The E-Stop and the guard limit switch are called "safety interlocks." NEVER rely on a PLC tostop a machine if a contact of a safety interlock is open. ALWAYS use an interlock in a

    hardwired, fail-safe circuit. Use additional contacts from the switches and wire them to inputs ofthe PLC so that it knows the machine is to be stopped, or has stopped.

    It is very important to label the bits properly. Arrange the verbs and nouns correctly. If you do,the rung will read like a sentence. You can look at this rung and say If the Emergency Stop isCleared and the Guard is in Place and there is no System Fault and the Start System button ispressed and the Stop System button is not pressed the System Running coil will turn on andlatch itself.

    There are some simple rules that I always follow when I am writing a description for a bit:

    -

    Descriptions for bits portray an action.

    - Descriptions are written to describe the normally open condition of the bit.

    - The description is true when the normally open instruction of the bit is on.

    - The description is false when the normally open instruction of the bit is off.

    | ***** Ensure all machine safeties have been made to allow| the system to be enabled.||EmergStop Guard in Start Stop|Cleared Place System System System System|CR1 LS26 Fault PB2 PB3 Running| INPUT5 INPUT26 COIL50 INPUT2 INPUT3 COIL1

    1 [---] [--------] [--------]/[----+----] [----+----] [----------( OUT )| | || | || | System || | Running || | COIL1 || +----] [----+

    The main reason for setting a master System Running bit is to simplify the program. Forexample, we dont want the spindle motor to run if the e-stop has been pressed, or if the guardis not in place, or if there is a system fault. Rather than putting all of these bits in the rung thatcontrols the spindle motor, we can summarize all of these bits and make the System Runningbit. We can then place just that bit in the rung that controls the spindle motor and know that wehave met all the criteria to allow the spindle motor to run.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    17

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    18/77

    Pilot Light Test

    The next two rungs provide a pilot light test. The idea is to turn on all the pilot lights for a coupleof seconds so you can verify that all the lights work. This feature is very handy when you are

    troubleshooting a machine.

    When the Emergency stop is first cleared, Timer 0 is started.

    | ***** Perform a pilot light test upon clearing the| emergency stop.||| +--Pilot-+|EmergStop | Light||Cleared | Test ||CR1 | Time |

    |INPUT5 TIMER0 |2 [---] [----------------------------------------------------+--2SEC--+|||

    During the period when the Emergency Stop is clear but the timer is not finished, the Pilot LightTest bit is on. The result is that all the pilot lights will turn on for two seconds after the E-Stop iscleared. This bit is then used throughout the program.

    | ***** Test the pilot lights.

    ||EmergStop Pilot Pilot|Cleared Light Light|CR1 Test Time Test|INPUT5 TIMER0 COIL2

    3 [---] [-------]/[----------------------------------------------( OUT )|

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    18

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    19/77

    Indicate The System Is Operational

    Let the operator know that the safeties have been made and the machine is ready to run.

    |

    | ***** Indicate the system is operational.||| System|System Running|Running PL20| COIL1 OUTPUT20

    4 [---] [---+----------------------------------------------------( OUT )| ||Pilot ||Light ||Test ||COIL2 |[---] [---+|

    |

    Machine Operation Mode

    Here we look at the Manual/Auto Mode selector switch to set the machine mode. You want toenable certain machine functions in Auto Mode, and disable some in Manual Mode, and viceversa. Notice how the System Running bit is used. If we lose that bit, such as when theemergency stop is pressed or the machine guard is opened, neither mode is valid.

    The state of the bits below indicates that the System Mode Selector switch is in Auto.

    || ***** Determine the mode of machine operation.||| System In System in|System Auto Mode Manual|Running SS4 Mode| COIL1 INPUT4 COIL5

    5 [---] [-------]/[--------------------------------------------( OUT )|||

    | System In|System Auto Mode System in|Running SS4 Auto Mode| COIL1 INPUT4 COIL4

    6 [---] [-------] [--------------------------------------------( OUT )|

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    19

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    20/77

    Run The Spindle Drive Motor

    This rung turns on the drill press spindle motor. It will come on immediately in automatic mode,but it can also be controlled by the Start Press and Stop Press switches in manual mode.

    | ***** Run the spindle drive motor of the drill press. A| manual mode is provided to allow ease of set-up.||| Run Drill|System in Press|Auto Mode MS5| COIL4 OUTPUT5

    7 [---] [-----------------------+----------------------------( OUT )| ||SystemIn Start Stop ||Manual Press Press ||Mode PB6 PB7 || COIL5 INPUT6 INPUT7 |[---] [---+---] [---+---] [---+| | || |Run Drill|| |Press || |MS5 || | OUTPUT5|| +---] [---+|

    Indicate The Spindle Drive Is Running

    Turn on the pilot light to let the operator know the motor is running.

    || ***** Indicate the drill press is running.|||Run Drill DrillPres|Press Running|MS5 PL21| OUTPUT5 OUTPUT21

    8 [---] [---+------------------------------------------------( OUT )| ||Pilot ||Light ||Test || COIL2 |[---] [---+

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    20

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    21/77

    Run The Infeed Conveyor

    Run the conveyor all the time when the machine is in auto mode. Note the use of the System InAuto Mode bit to ensure all machine safety conditions have been met.

    || ***** Run the infeed conveyor if the machine is| in automatic mode.||| RunInfeed|System in Conveyor|Auto Mode MS1| COIL4 OUTPUT1

    9 [---] [---------------------------------------------------( OUT )||

    Ensure There Are No Parts In The MachineYou want to make sure there are no parts in the machine before you start a cycle. Thesephotoeyes are positioned so that if they "see" a part, they will turn on the input. A part will breakthe beam, the input will turn on and you know you have a part present.

    In this rung, we want to make sure there is no part in the machine. The rung will only be true ifall the photoeyes indicate there is not a part present.

    || ***** Ensure there are no parts in the machine to start the| drilling cycle.|||Placed in Placed in Part at Part No Part|X-Axis Y-Axis Home Cleared In|PSC31 PSC32 PSC33 PSC34 Machine| INPUT31 INPUT32 INPUT33 INPUT34 COIL20

    10 [---]/[---------]/[---------]/[---------]/[-------------------( OUT )||

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    21

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    22/77

    Ensure All Components Are At Home

    Make sure all the moving parts of the machine are at their initial or "home" position before youallow any automatic motion to begin. This is standard on most machines.

    | ***** Ensure all components are at home.|||Hold Part Drilling Spindle|In Place Stop Gate Raised Machine|SOL11 SOL12 PRS35 At Home|OUTPUT11 OUTPUT12 INPUT35 COIL21

    11 [---]/[---------]/[---------] [--------------------------( OUT )|

    Begin The Cycle

    Here is the rung that starts the machine's automatic cycle. When the operator goes to AutoMode, and there are no parts in the machine, and the machine components are at home, thecycle will begin. You might ask, "If there is a part in the press, wouldn't the machine startrunning as soon as the operator took the part out?" The answer has to be no. You don't wantthis machine to start running when someone clears a part. In our case, to remove a part theoperator would have to open the machine guard door in order to physically remove the part, andthat would kick the machine out of automatic mode. He would have to close the guard and startthe machine again.

    || ***** Begin the cycle when the part has cleared the machine| and all components are at home. Bit coil22 will stay on| during the entire drilling cycle and drop out when an end of cycle| signal is generated.||| No Part End of|System in In Machine Machine Machine|Auto ModeMachine At Home Cycle InCycle| COIL4 COIL20 COIL21 COIL24 COIL22

    12 [---] [---+---] [-------] [---+---]/[--------------------------( OUT )| | || | || |Machine || |InCycle || | COIL22 || +---] [-------------+

    |

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    22

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    23/77

    Lower The Stop Gate

    Lower the stop gate when the machine is in cycle.

    | ***** Lower the stop gate to stop the part under the

    | spindle.||| Drilling|Machine StopGate|InCycle SOL12| COIL22 OUTPUT12

    13 [---] [-----------------------------------------------( OUT )|

    Run The Main Conveyor

    Bring the part into position by running the conveyor in the press. Note that the PLC will stop theconveyor after the part has been clamped in place (Rung 16), but until that happens, theconveyor will run.

    || ***** Run the main conveyor unless a part is being clamped.||| HoldPart RunMain|System in InPlace Conveyor|Auto Mode SOL11 MS2

    | COIL4 OUTPUT11 OUTPUT214 [---] [---------]/[-----------------------------------------( OUT )|

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    23

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    24/77

    Indicate The Part Is In Place

    The photoeye PSC33 is physically placed so that the part will block the beam of the photoeyewhen the part is in place. This rung will let the operator know that.

    | ***** Indicate the part is in place and ready to be drilled.|||Partat PartIn|Home Place|PSC33 PL22|INPUT33 OUTPUT22

    15 [---] [---------------------------+-------------------------( OUT )| ||Pilot ||Light ||Test || COIL2 |

    [---] [---------------------------+

    Clamp The Part In Place

    When the part is in position, the PLC will clamp it in place. Since the Hold Part In Place bit isused in Rung 14, the main conveyor will stop running.

    Also, a manual method of holding the part has been provided for machine set-up.

    || ***** Clamp the part in place after it has reached the| proper position.||| Partat HoldPart|Machine Home InPlace|InCycle PSC33 SOL11| COIL22 INPUT33 OUTPUT11

    16 [---] [---------] [-----------------------------+-------( OUT )| ||System in HoldPart ||Manual InPlace ||Mode PB12 || COIL4 INPUT12 |

    [---] [---------] [-----------------------------+||

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    24

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    25/77

    Lower The Spindle

    The spindle of the press is a variable speed motor. This particular drive has two inputs; one tomake the motor go forward (move the spindle down) and one to make the motor go in reverse

    (move the spindle up). So, when the part is held in place, the PLC will command the drive tolower the spindle until it reaches the lower limit (Spindle Lowered) proximity switch.

    The Raise Spindle bit (OUTPUT6) from Rung 19 is used to keep the drive from trying to lowerthe spindle until after the drilling has been completed. We dont want to tell the spindle to lowerand raise at the same time.

    || ***** After the part has been clamped in place, lower the| spindle. The feed rate is determined by a variable speed| drive.||| HoldPartSpindle Raise Lower|Machine InPlace Lowered Spindle Spindle|InCycle SOL11 PRS36 DRV1RAISE DRV1LOWER| COIL22 OUTPUT11 INPUT36 OUTPUT6 OUTPUT7

    17 [---] [---+---] [---+---]/[-------]/[---+----------------( OUT )| ||System in Lower ||Manual Spindle ||Mode PB11 || COIL5 INPUT11 |[---] [-------] [-----------------------+|

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    25

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    26/77

    Drilling Operation Is Complete

    When the spindle has reached the end of travel and activates the Spindle Lowered prox switch,an internal bit is set to indicate that the drilling operation is complete.

    || ***** The drilling operation is complete if the spindle| reaches the lower limit in automatic mode.||| Spindle Drilling|Machine Lowered Operation|InCycle PRS36 Complete| COIL22 INPUT36 COIL23

    18 [---] [---+---] [---+--------------------------------------( OUT )| | || |Drilling|| |Operation|| |Complete|

    | | COIL23 || +---] [---+|

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    26

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    27/77

    Return The Spindle To Its Home Position

    After the drilling operation is complete, a latch is set to raise the spindle. Since the spindle isbelow the SPINDLE RAISED proximity switch, the PLC will tell the spindle to raise. As soon asthe spindle reaches the upper end of travel and trips the SPINDLE RAISED proximity switch, thelatch drops out.

    A manual method of raising the spindle is also provided.

    || ***** After the spindle has reached the lower limit of its| travel, return the spindle to its home position.||| Drilling Spindle Raise|Machine Operation Raised Spindle|InCycle Complete PRS35 DRV1RAISE

    | COIL22 COIL23 INPUT35 OUTPUT619 [---] [---+---] [---+-----]/[---+----------------------------( OUT )| | | || |Raise | || |Spindle | || |DRV1RAISE| || | OUTPUT6| || +---] [---+ || ||System in Raise ||Manual Spindle ||Mode PB10 || COIL5 INPUT10 |[---] [----------] [------------+||

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    27

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    28/77

    Machine Cycle Is Complete

    This rung terminates the machine cycle. The drilling is done and the spindle is back in its homeposition, so the End of Machine Cycle bit is latched. When this bit goes high, it causes theMachine In Cycle latch to drop out (Rung 12). This in turns raises the stop gate (Rung 13),releases the part (Rung 15) and turns on the main conveyor (Rung 14). The End of MachineCycle latch drops out when the Machine In Cycle bit goes low. When the part clears all thephotoeyes, the stop gate lowers and the machine waits for another part.

    | ***** The machine cycle is complete if the drilling| operation is complete and the spindle is raised.||| Drilling Spindle End of|Machine Operation Raised Machine|InCycle Complete PRS35 Cycle

    | COIL22 COIL23 INPUT35 COIL2420 [---] [---+---] [---------] [---+---------------------------( OUT )| | || |End of || |Machine || |Cycle || | COIL24 || +---] [---------------+

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    28

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    29/77

    Fault Detection And System Diagnostics

    This section of the program evaluates problems and monitors the machine. The machine wouldstill run without these rungs, but they make life a lot easier for the operators and could prevent

    the machine from damaging itself.

    | ____________________________________________________________| | || | FAULT DETECTION AND SYSTEM DIAGNOSTICS || |__________________________________________________________|

    Personnel Safety Guard Door

    Let the operator know if the guard door is open. You might think this should be obvious, but it isnice to have a red light come on when a safety gate is open. It makes people take a little morecare when working around the machine.

    | **** Indicate if the personnel safety guard door is open.||Guard in Guard|Place Open|LS26 PL25| INPUT26 OUTPUT25

    21 [---]/[---+------------------------------------------------( OUT )| ||Pilot ||Light ||Test |

    | COIL2 |[---] [---+

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    29

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    30/77

    Low Compressed Air Pressure

    It is a good idea to keep track of the compressed air pressure. The machine will not operateproperly if there is insufficient air pressure. You can put it on a fairly long time delay, becauseyou don't care about momentary drops in pressure, like a second or two. But when it does dropbeyond the lower limit for enough time, you want the machine to stop.

    You also want it to latch so you know why the machine stopped running. The air pressure couldcome back up before the operator sees the pilot light, and he would be left scratching his head.The latch is reset by the Reset System pushbutton.

    | ***** Detect abnormally low compressed air pressure.|||AirPressr +--Air -+|Normal | Pressure ||PS27 | Abnormal || INPUT27 TIMER27 |

    22 [---]/[-------------+---------------------------------+---4SEC-----+| ||Air Reset ||Pressure System ||Abnormal PB1 || TIMER27 INPUT1 |[---] [-------]/[---+||| ***** Indicate abnormally low air pressure.||Air LowAir|Pressure Pressure|Abnormal PL26

    | TIMER27 OUTPUT2623 [---] [---+-------------------------------------------------( OUT )

    | ||Pilot ||Light ||Test || COIL2 |[---] [---+

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    30

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    31/77

    Motor Starter Overload

    If the auxiliary contacts in the motor starters don't pull in after one second, there is some kind ofproblem. You have to look at each one individually.

    | ***** The starter is assumed to be overloaded if the aux| contact does not pull in after 1 second.||RunInfeedInfedConv +--Infeed -+|Conveyor Running | Conveyor ||MS1 MS1AUX | Overload || OUTPUT1 INPUT20 TIMER1 |

    24 [---] [-------]/[-------------------------------------+--1SEC------+||||RunMain MainConv +--Main -+|Conveyor Running | Conveyor ||MS2 MS2AUX | Overload || OUTPUT2 INPUT23 TIMER3 |

    25 [---] [-------]/[-------------------------------------+---1SEC-----+|||RunDrillDrillPres +--Drill -+|Press Running | Press ||MS5 MS5AUX | Overload ||OUTPUT5 INPUT24 TIMER5 |

    26 [---] [-------]/[-------------------------------------+---1SEC-----+||

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    31

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    32/77

    Latch The Motor Overload Detection

    If any of the overload timers finish, latch the alarm bit. When the operator presses the ResetSystem pushbutton, the alarm will be cleared.

    | ***** Latch the motor overload detection.||Infeed Reset Motor|Conveyor System Overload|Overload PB1 Detected| TIMER1 INPUT1 COIL40

    27 [---] [---+---]/[-------------------------------------------( OUT )| ||Main ||Conveyor||Overload|| TIMER3 |[---] [---]| ||Drill ||Press ||Overload|| TIMER5 |[---] [---]| ||Motor ||Overload||Detected|| COIL40 |[---] [---+

    Indicate A Motor Overload Condition

    Display the alarm.

    | ***** Indicate a motor overload condition.|||Motor Motor|Overload Overload|Detected PL24| COIL40 OUTPUT24

    28 [---] [---+-------------------------------------------------( OUT )| |

    |Pilot ||Light ||Test || COIL2 |[---] [---+

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    32

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    33/77

    Jammed Part Detection

    Rung 30 contains what is known as a "watchdog timer." A watchdog timer keeps track of theamount of time it takes for a machine to complete a given process. If a part is sitting in the

    machine for more than 30 seconds while the machine is in cycle, then the part is probablyjammed. This is also a good indication of a photoeye that has become dirty and blocked. It willalso tell you if a conveyor belt stopped turning.

    | ***** A part is jammed if a photocell detects a part for| more than 30 seconds during the machine cycle.|| Placed in +--Part -+|Machine X-Axis | Jam ||InCycle PSC31 | Time || COIL22 INPUT31 TIMER34 |

    29 [---] [---+---] [---+---------------------------------+--30SEC-----+

    | | || |Placed in|| |Y-Axis || |PSC32 || | INPUT32|| [---] [---]| | || |Partat || |Home || |PSC33 || | INPUT33|| [---] [---]| | || |Part || |Cleared || |PSC34 || | INPUT34|| +---] [---+

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    33

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    34/77

    Latch The Part Jammed Detection

    | ***** Latch the part jammed detection.|

    |Part|Jam PartJam|Time Detected| TIMER34 COIL34

    30 [---] [-------------+---------------------------------------( OUT )| || Reset ||PartJam System ||Detected PB1 || COIL34 INPUT1 |[---] [-------]/[---+||

    Indicate A Part Jammed Condition

    | ***** Indicate a part jammed condition.|| Part|PartJam Jammed|Detected PL23| COIL34 OUTPUT23

    31 [---] [---+------------------------------------------------( OUT )| ||Pilot ||Light ||Test || COIL2 |[---] [---+

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    34

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    35/77

    Monitor The Drill Time

    Keep an eye on the drill time. If this timer finishes, there could be a bad prox switch, a brokendrill bit or a spindle drive malfunction.

    | ***** Monitor the drill time.|| Spindle +--Drill -+|Machine Raised | Watchdog ||InCycle PRS35 | Timer || COIL22 INPUT35 TIMER35 |

    32 [---] [-------]/[-------------------------------------+---8SEC-----+|| ***** Latch the excessive drill time detection.||Drill Excessive|Watchdog DrillTime|Timer Detected| TIMER35 COIL35

    33 [---] [-------------+--------------------------------------( OUT )| ||ExcessiveReset ||DrillTimeSystem ||Detected PB1 || COIL35 INPUT1 |[---] [-------]/[---+

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    35

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    36/77

    Summarize The Fault Conditions

    This rung puts all the faults together to supply one bit to shut off the machine if any of theseproblems are detected. The System Fault (COIL50) is used, as you recall, in Rung 1 to stopthe machine if there is any problem.

    || ***** Summarize the fault conditions and stop all machine| motion if any one of these faults occur.|||Guard in|Place System|LS26 Fault| INPUT26 COIL50

    34 [---]/[---+-----------------------------------------------( OUT )| ||Air ||Pressure||Abnormal|| TIMER27|[---] [---]| ||Motor ||Overload||Detected|| COIL40 |[---] [---]| || ||PartJam||Detected|| COIL34 |[---] [---]

    | ||Excessive||DrillTime||Detected|| COIL35 |+---] [---+

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    36

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    37/77

    13 Marks Of A Well Written Program

    A well written program will:

    - meet the specified production requirements of time a quality control.

    - always tells the operator why the PLC stopped the machine.

    - be as simple as possible.

    - use a minimum of ladder logic.

    - not violate any specs (NEC, JIC, client, etc.)

    - make the machine easy to start and operate.

    - recover well from a fault.

    - tolerate physical variations and mechanical adjustment (changing belt speed,deviations in air pressure, cylinder speeds, etc.)

    - detect bad machine components, if at all possible.

    - be easy to understand and troubleshoot.

    - stand the test of time.

    - not let the machine break itself.

    - make the machine sound good and run smoothly.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    37

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    38/77

    General PLC Tips

    Here are a few general PLC tips:

    The only true test of program integrity and reliability is time. If someone tells you about problemwith a program that has been running for few days, consider the program. If the program hasbeen running for a few months, consider other potential problems, such as a hardware failure ofa peripheral device.

    Get as many different PLC programming manuals as you can find and hold onto them. Manycompanies use PLCs that are older models, and you never know when you might run acrossone.

    Avoid putting two devices in series on a PLC input, or paralleling two devices on an output. Mostalways, you will end up regretting it.

    Assign wire numbers and device numbers going from your I/O to match the respective input oroutput.

    Don't use timers in the process loop of a program. Write event-triggered programs, based onactual changes in temperature, position, speed and so on.

    Backup your program files frequently, but don't erase your old files until you are sure you don'tneed them. Always know how to retrace your footsteps.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    38

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    39/77

    The Automated Drill Press in Rockwell

    Automations RSLogix 500

    The most popular and most widely used manufacturer of PLCs is Rockwell Automation, whoproduces the Allen-Bradley MicroLogix and SLC series of PLCs. The MicroLogix and SLCfamilies of processors and I/O modules are all programmed using Rockwells proprietarysoftware known as RSLogix.

    I used a generic style of ladder logic in the first part of the book to explain the fundamentals ofladder logic. This style was chosen because it applies to all types of PLCs.

    To give you a better understanding of how the program would look in a real world situation, Ihave included the same Automated Drill Press program as it would appear if it were written in

    Allen-Bradleys RSLogix.

    Here is an example:

    I will give you a brief outline of the differences between the generic format of ladder logic that Iused and RSLogixs format:

    First, though, the address descriptions and the rung comments are the same in the RSLogixprogram as they are in the generic program. Despite what the numbers say under the

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    39

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    40/77

    instruction, System in Auto Mode is the same bit here as the System in Auto Mode is in thegeneric program.

    OutputsAllen-Bradley labels their outputs starting with a capital O, whereas we used output in the

    generic program. In the rung above, O:3/2 is the same bit as OUTPUT5 in our genericprogram.

    1746-O*16 indicates the type of output module.

    InputsAllen-Bradley labels their inputs starting with a capital I, whereas we used input. In the rungabove, I:1/5 is the same bit as INPUT5 in our generic program.

    1746-I*16 indicates the type of input module.

    Coils (internal bits)Allen-Bradley labels mosttheir internal coils starting with a capital B3, whereas we usedout. In the rung above, B3:0/2 is the same bit as COIL4 in our generic program.

    Cross ReferenceThe RSLogix program shows cross-referencing. The number 2:5 under the first instructionmeans that the output (or, coil) for that address is found in file 2, rung 5.

    2 is the first, and default, data file of a ladder in RSLogix.

    The output O:3/2 shows that its contacts are found on rungs 6, 7 and 25 of data file 2.

    Rung NumbersRSLogix starts with rung 0000 the generic program starts with rung 1, so the rung numbersshown in the RSLogix program will be one less than the rung numbers in the generic program.

    Logic FlowBits that are true in our RSLogix program are shown with a green highlight. This RSLogix ladderprintout above is a snapshot showing the system in automatic mode, the part is in place andthe drill bit is being lowered. There are no faults.

    Other InformationRSLogix will provide a variety of information regarding the program and hardware. I haveincluded those pages here.

    If you want to gain a firm understanding of RSLogix, you may be interested in PLCProgramming with RSLogix 500 How to Program an Allen-Bradley SLC 500 with Rockwell

    Automations RSLogix 500. This ebook provides a step-by-step tutorial on how to create anautomatic batching program in Allen-Bradleys RSLogix 500. It is published exclusively byModern Media and is available at http://www.modernmediaonline.com.

    Beginners Guide to PLC ProgrammingHow to Program a PLC (Programmable Logic Controller)Copyright2008 Modern Media

    modernmediaonline.com

    40

    http://www.modernmediaonline.com/http://www.modernmediaonline.com/
  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    41/77

    RSLogix500 Project Report

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    42/77

    DRILPRES.RSS

    Processor Information

    essor Type: 1747-L553B 5/05 CPU - 64K Mem. OS501 Series C

    essor Name: DRILPRES

    l Memory Used: 173 Instruction Words Used - 127 Data Table Words Used

    l Memory Left: 61267 Instruction Words Left

    ram Files: 3

    Files: 9

    ram ID: d065

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    43/77

    DRILPRES.RSS

    I/O Configuration

    1747-L553B 5/05 CPU - 64K Mem. OS501 Series C1746-I*16 Any 16pt Discrete Input Module1746-I*16 Any 16pt Discrete Input Module1746-O*16 Any 16pt Discrete Output Module

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    44/77

    DRILPRES.RSS

    Channel Configuration

    RALhannel 1 Write Protected: Nohannel 1 Edit Resource/Owner Timeout: 60hannel 1 Passthru Link ID: 2hannel 1 Diagnostic File: 0

    hannel 0 Write Protected: Nohannel 0 Edit Resource/Owner Timeout: 60hannel 0 Passthru Link ID: 1hannel 0 Current Mode: System

    hannel 0 Mode Change Enabled: Nohannel 0 Mode Change Attention Character: \1bhannel 0 Mode Change System Character: Shannel 0 Mode Change User Character: Uhannel 0 Diagnostic File: 0

    NEL 1 (SYSTEM) - Driver: Ethernetroadcast Address: 0.0.0.0ardware Address: 00:00:00:00:00:00P Address: 0.0.0.0ubnet Mask: 0.0.0.0ateway Address: 0.0.0.0Msg Connection Timeout (x 1mS): 15000

    Msg Reply Timeout (x mS): 3000nactivity Timeout (x Min): 30ootp Enable: Yesootp Valid: Noontact:ocation:

    NEL 0 (SYSTEM) - Driver: DF1 Full Duplexource ID: 0 (decimal)aud: 19200arity: NONEtop Bits: 1ontrol Line : No Handshakingrror Detection: CRC

    mbedded Responses: Enableduplicate Packet Detect: YesACK Timeout: 50AK Retries: 3NQ Retries: 3

    NEL 0 (USER) - Driver: ASCIIaud: 19200arity: NONEtop Bits: 1ata Bits: 8ontrol Line : No Handshakingelete mode: Ignore

    cho: NoON/XOFF: Noermination Character 1: \dermination Character 2: \ffAppend Character 1: \dAppend Character 2: \a

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    45/77

    DRILPRES.RSS

    Program File List

    Number Type Rungs Debug Bytes

    TEM] 0 SYS 0 No 01 SYS 0 No 0

    N 2 LADDER 35 No 1182

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    46/77

    DRILPRES.RSS

    Data File List

    Number Type Scope Debug Words Elements Last

    PUT 0 O Global No 3 1 O:0T 1 I Global No 6 2 I:1

    TUS 2 S Global No 0 83 S:82RY 3 B Global No 1 1 B3:0R 4 T Global No 108 36 T4:35

    NTER 5 C Global No 3 1 C5:0TROL 6 R Global No 3 1 R6:0

    GER 7 N Global No 1 1 N7:0AT 8 F Global No 2 1 F8:0

  • 7/25/2019 Beginners Guide to PLC Programming [Neal Babcock] 2008

    47/77

    DRILPRES.RSS

    LAD 2 - MAIN --- Total Rungs in File = 35

    Ensure all machine safeties have been made to allow the system to be enabled.

    0I:1/4

    1746-I*16

    EmergStopClearedCR1

    I:2/4

    1746-I*16

    Guard inPlaceLS26

    B3:0/12

    SystemFault

    2:33

    I:1/1

    1746-I*16

    StartSystemPB2

    B3:0/0

    SystemRunning

    2:0

    I:1/2

    1746-I*16

    StopSystemPB3

    B3:0/0

    SystemRunning

    B3:0/0 - XIC - 2:0, 2:3, 2:42:5

    Perform a pilot light test upon clearing the emergency stop.

    1I:1/4

    1746-I*16

    EmergStopClearedCR1

    EN

    DN

    TONTimer On DelayTimer T4:0Time Base 1.0Preset 2