Transcription of MET 382 PLC Fundamentals - Ladder fundamentals - Spr …
1 MET 3821/14/2008 Ladder Logic Fundamentals1 PLC Fundamentals Ladder Logic FundamentalsMET 382 MET 382 Controls & Instrumentation Controls & Instrumentation for Automationfor AutomationSpring 08 Spring KostekTopics PLC programming languages PLC programming languages Anatomy of a Ladder program Logic functions Logical continuity vs. electrical continuity I/O Mapping Mastering examine on and examine off2 Mastering examine on and examine off instructions The PLC scanning processMET 3821/14/2008 Ladder Logic Fundamentals2 PLC programming Languages In the United States, Ladder logicis the most popular gppmethod used to program a PLC This course will focus primarily on Ladder logic programming Other programming methods include: Function block diagrams (FBDs)3 Structured text (ST) Instruction List (IL) Sequential function charts (SFCs)Anatomy of a Ladder ProgramInput Instructions (conditions)Output Instructions (actions)Rung 0 Rung 14 Rung 2 Right power railLeft power railMET 3821/14/2008 Ladder Logic Fundamentals3 Anatomy of a Ladder Program (cont d) Input instructions are entered on the left Input instructions are entered on the left Output instructions are entered on the right The power rails simulate the power supply lines L1 and L2 for AC circuits and +24 v and ground for DC iit5DC circuits Most PLCs allow more than one output per rungAnatomy of a Ladder Program (cont d) The processor (or controller ) scans The processor (or controller )
2 Scans Ladder rungs from top-to-bottom and from left-to-right. The basic sequence is altered whenever jump or subroutine instructions are executed. 6 MET 3821/14/2008 Ladder Logic Fundamentals4A3-rung example Ladder programAnatomy of a Ladder Program (cont d)A 3rung example Ladder program7 Anatomy of a Ladder Program (cont d)Rung CommentRung Number8 Rung NumberDescription assigned to alias tagAlias tag pointing to base addressBase addressInput InstructionMET 3821/14/2008 Ladder Logic Fundamentals5 Logic Functions PLC programming is a logical procedure In a PLC program, things (inputs and rungs) are either TRUE or FALSE If the proper input conditions are TRUE: The rung becomes TRUE and an output action occurs9 The rung becomes TRUE and an output action occurs (for example, a motor turns on) If the proper input conditions are not TRUE.
3 The rung becomes FALSE and an output action does notoccurLogic Functions (cont d) Ladder logic is based on the following gglogic functions: AND OR Sometimes called inclusive OR Exclusive OR10 Exclusive ORMET 3821/14/2008 Ladder Logic Fundamentals6 Logic Functions - AND Ot tInput 1 ANDO utputInput 2 LogicInput 1 Input 2 Output0000101000 False1 True11( )Contacts ANDed together100111 Logic Functions - OR Ot tInput 1 OROutputInput 2 OLogicInput 1 Input 2 Output0000111011110 False1 True12( )Contacts ORedtogether111 MET 3821/14/2008 Ladder Logic Fundamentals7 Logic Functions - Exclusive OR In addition to ANDing and ORing, the Exclusive OR (XOR) is also useful. When the inputs are DIFFERENT, the XOR ttitOutputInput 1 Input 2 XORL ogicoutput is true.
4 13 Input 1 Input 2 Output0000111011100 False1 TrueLogic Functions (cont d) Example 1 Inputs ANDed together in seriesInputsOutput14 Three input instructions ANDed together. All 3 input instructions must be true in order to energize the outputMET 3821/14/2008 Ladder Logic Fundamentals8 Logic Functions (cont d) Example 2 Inputs ORed together in parallelInputsOutput15 Three input instructions ORed together. If any of the 3 input instructions are true the output will be energizedLogic Functions (cont d) Example 3 A combination of ANDing and ORing16 MET 3821/14/2008 Ladder Logic Fundamentals9 Logical Continuity Logical continuityin a Ladder rung occurs when Logical continuityin a Ladder rung occurs when there is a continuous path of TRUE conditions from the left power rail to the output instruction(s)
5 When there is logical continuity, the rung becomes true and the output becomes energized17becomes true and the output becomes energizedLogical Continuity Example 1 Rung 0 TRung FalseFTRung 1 Rung FalseRTFThis input instruction is falseThis input instruction is true18 Rung 2 Left power railRight power railFTTRung TrueTMET 3821/14/2008 Ladder Logic Fundamentals10 Logical Continuity Example 2 Virtual power flow (not actual current flow)Rung true due to this branchPath of logical continuity19 TRUE conditions are highlighted in greenon the programming panels display PLCPLC--5 Systems5 SystemsLogical Continuity vs. Electrical Continuity Electrical continuityin an input circuit, occurs when thereElectrical continuityin an input circuit, occurs when there is a complete path for current to flow.
6 A PLC input circuit is a simple series circuit consisting of a: Power supply, Switch, and a Load 20 When there is electrical continuity, a bit in the PLCs memory (sometimes called the input image table) is set to a 1. MET 3821/14/2008 Ladder Logic Fundamentals11 Electrical ContinuityNormally open ( ) pushbutton [shown pushed]+24vCOMI nput ModuleInput Circuitry21 Electrical Continuity+24vCOMI nput Module+-Power supply is impliedInput ModuleInput CircuitryScrew terminals22 Power railPower railMET 3821/14/2008 Ladder Logic Fundamentals12 Logical vs. Electrical Continuity Note: It s possible to have electrical continuity and not have logical continuity (and vise versa). PB0 - pushbutton (shown pushed)This instruction is false when the pushbutton is pushedI PB0 Ladder Program:Control Wiring Diagram.
7 23 Electrical Continuity( )No Logical ContinuityI_PB0I/O Mapping Every discrete input is assigned to a specific bit in the PLC s memory (input image table)in the PLC s memory (input image table) If there is electrical continuity, the bit is set to a 1 If there is no electrical continuity, the bit is reset to a 0 Every discrete output is assigned to a specific bit in the PLC s memory (output image table)24in the PLC s memory (output image table) In order for an output to turn on, its associated bit must first be set to a 1 MET 3821/14/2008 Ladder Logic Fundamentals1300020406101214161 word (16 bits)PLC Data TableInput Image Table(only 1 word shown)input, PB1 InputmoduleNote: Bit addresses are given in octal for an Allen-Bradley PLC-5 system The bits are 00000000000000000103050711131517 Output Image Table(only 1 word shown)input, PB1output , LT1I:XXX/10numbered 0 17 2500000000000000000001020304050607101112 1314151617(only 1 word shown)output , LT1 ROutput ModuleO:XXX/01 PLCPLC--5 Systems5 SystemsI/O MappingInput Image Table Output Image Table in RSLogix 5 software26in RSLogix 5 software PLCPLC--5 Systems5 SystemsMET 3821/14/2008 Ladder Logic Fundamentals14I/O MappingOutput Image Table in RSLogix 5:O:005 is a 16 bit word address:O:005/07 is the 27 PLCPLC--5 Systems5 Systemsaddress of a bit which resides in the word O:005I/O MappingInput Image Table in RSLogix 5.
8 1 word = 16 bits (bits are numbered in octal for a PLC-5)28 PLCPLC--5 Systems5 SystemsMET 3821/14/2008 Ladder Logic Fundamentals15I/O MappingControlLogix tag database:29 ControlLogix SystemsControlLogix SystemsAlias tag(a pointer to a base address)Base address (real address)Current tag valueMastering Examine On & Examine Off Instructions Discrete input devices have normally Discrete input devices have normally open ( ) and/or normally closed ( ) contacts. Example: Pushbuttons can be purchased with either or mechanical contacts. 30 Normally implies the state of the contacts when you are NOT pushing the button. MET 3821/14/2008 Ladder Logic Fundamentals16 Mastering Examine On & Examine Off Instructions Normally open ( ) vs. normally closed ( ) contacts:Contact Type:Resistance between contacts when NOT pushed:Resistance between contacts when ohmsZero ohmsInfinite ohmsMastering Examine On & Examine Off Instructions PLC programs have both normally open and normally closed input closed input instruction32 Normally open input instructionypMET 3821/14/2008 Ladder Logic Fundamentals17 Mastering Examine On & Examine Off Instructions TheExamine OnInstruction The Examine OnInstructionThis input instruction examines the specified bit for a logic 1.
9 If the bit is a 1, the instruction is true, otherwise the instruction is is generally known as a normally openinput Examine On & Examine Off Instructions TheExamine OnInstruction The Examine OnInstructionThis is the address assigned to the instruction (I:007/00). Note: This instruction must beassigned a bit addressnota34 This is the instructionassigned a bit address, nota word address. PLCPLC--5 Systems5 SystemsMET 3821/14/2008 Ladder Logic Fundamentals18 Mastering Examine On & Examine Off Instructions TheExamine OffInstruction The Examine OffInstructionThis input instruction examines the specified bit for a logic 0. If the bit is a 0, the instruction is true, otherwise the instruction is is generally known as a normally closedinput Examine On & Examine Off Instructions Examine On instructions are also called: Examine On instructions are also called: XIC, eXamine If Closed Examine Off instructions are also called: XIO, eXamine If Open36 Note: The terms Examine on, Examine off, Examine if closed (XIC), and Examine if open (XIO) are unique to Allen-Bradley PLCs.
10 MET 3821/14/2008 Ladder Logic Fundamentals19 Mastering Examine On & Examine Off Instructions Examine On and Examine Off Instructions Examine On and Examine Off Instructions that are Trueare highlighted green in the PLC programming software:37 TrueFalseMastering Examine On & Examine Off Instructions A program can Examine On (or Examine Off) real pg()inputs, real outputs, internal storage bits, timer done bits, ON a real inputExamine OFF an internal storage bitExamine ON a real outputMET 3821/14/2008 Ladder Logic Fundamentals20 Mastering Examine On & Examine Off Instructions Input and output field devices are wired to PLC discrete Input/Output (I/O) modules. How the system functions depends on the program!FANS tart( )PLC120 VAC+24 VDCsutsTwo pushbuttons wired to two PLC inputs39 Stop( )FANI nputsOutpu(Continued on next slide.)