5: Ladder Logic - NOTES

Similar documents
TIMING, COUNTING, AND DATA-HANDLING INSTRUCTIONS. Key Points

Programming Timers CHAPTER 4-1 GOALS AND OBJECTIVES 4-2 MECHANICAL TIMING RELAYS

LADDER LOGIC/ FLOWCHART PROGRAMMING DIFFERENCES AND EXAMPLES

Introduction to LogixPro - Lab

3BASIC RELAY INSTRUCTIONS

Programming A PLC. Standard Instructions

STEP 7 MICRO/WIN TUTORIAL. Step-1: How to open Step 7 Micro/WIN

11. FLOWCHART BASED DESIGN

Programming Examples. B.1 Overview of Programming Examples. Practical Applications. Instructions Used

2011, The McGraw-Hill Companies, Inc. Chapter 5

2011, The McGraw-Hill Companies, Inc. Chapter 9

Electrical Symbols and Line Diagrams

Analog Inputs and Outputs

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 OUTCOME 3 PART 1

Fig 3. PLC Relay Output

THE STEP7 PROGRAMMING LANGUAGE

TRILOGI 5.3 PLC Ladder Diagram Programmer and Simulator. A tutorial prepared for IE 575 by Dr. T.C. Chang. Use On-Line Help

Automating witfi STEP7 in LAD and FBD

Automating with STEP7 in LAD and FBD

Ladder and Functional Block Programming

Programmable Logic Controllers

EXPERIMENT 2 TRAFFIC LIGHT CONTROL SYSTEM FOR AN INTERSECTION USING S7-300 PLC

How to read this guide

Creating Relay Logic Diagrams

Programming Logic controllers

PLC SW and Programming. Nagy István, BMF BGK MEI

Programmable Logic Controllers

Notes on Assembly Language

(Cat. No L3) Product Data

101 BASICS SERIES LEARNING MODULE 24: PROGRAMMABLE LOGIC CONTROLLERS (PLCS) Cutler-Hammer

Successful completion of the course leads to the award of the Technical Training Solutions Competence Certificate PLC Programming

Programmable Logic Controllers Definition. Programmable Logic Controllers History

CHAPTER 11: Flip Flops

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15

Siemens S7 Status Word

Comp 255Q - 1M: Computer Organization Lab #3 - Machine Language Programs for the PDP-8

1 Classical Universal Computer 3

Training Manual for Cscape and XLe

Lesson-16: Real time clock DEVICES AND COMMUNICATION BUSES FOR DEVICES NETWORK

Traditional IBM Mainframe Operating Principles

Technical Training Classes Interactive Catalog of Online Courses

(Refer Slide Time: 00:01:16 min)

Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis

Programming Manual Catalog Numbers 1756 ControlLogix, 1769 CompactLogix, 1789 SoftLogix, 1794 FlexLogix, PowerFlex 700S with DriveLogix

PROGRAMMABLE LOGIC CONTROL

The 104 Duke_ACC Machine

1. True or False? A voltage level in the range 0 to 2 volts is interpreted as a binary 1.

ETEC 2301 Programmable Logic Devices. Chapter 10 Counters. Shawnee State University Department of Industrial and Engineering Technologies

Small Hardware Development and Prototyping Board for the SX28

PROGRAMMABLE LOGIC CONTROLLERS Unit code: A/601/1625 QCF level: 4 Credit value: 15 TUTORIAL OUTCOME 2 Part 1

PART B QUESTIONS AND ANSWERS UNIT I

The goal is to program the PLC and HMI to count with the following behaviors:

Two's Complement Adder/Subtractor Lab L03

Administrative Issues

Microprocessor & Assembly Language

I N G E N I E U R B Ü R O F Ü R TEC HNOLOGIE TRA NSFER DIPL.-I NG. B. P. SCHULZ-HEISE. Training Manual. STEP 5 S5 for Windows Training

SIMATIC. S Getting started with S Preface. Quick review 1. Installation 2. Create a simple latch circuit 3. Complete the user program 4

Systems I: Computer Organization and Architecture

HC12 Assembly Language Programming

ABB i-bus EIB Logic Module LM/S 1.1

1. Convert the following base 10 numbers into 8-bit 2 s complement notation 0, -1, -12

Introduction. - Please be sure to read and understand Precautions and Introductions in CX-Simulator Operation Manual and

Logix5000 Controllers Major, Minor, and I/O Faults

Logix5000 Controllers IEC Compliance

Technical Training Module ( 30 Days)

An Introduction to MPLAB Integrated Development Environment

LOGO! functions. LOGO! Manual A5E

S7 for Windows S7-300/400

MIDECO 64-outputs MIDI note decoder USER MANUAL. Roman Sowa 2012

Application Unit, MDRC AB/S 1.1, GH Q R0111

INGENIEURBÜRO FÜR TECHNOLOGIE TRANSFER DIPL.-ING. B. P. SCHULZ-HEISE. Getting Started with. S7 for Windows. Version 6.x

Chapter 8: Ladder Logic Language Reference

The string of digits in the binary number system represents the quantity

Mitsubishi Electric Q Series PLC Ladder Monitor. Operation Manual

ZEN-SOFT01-V3. Cat.No.W386-E1-03

Jianjian Song LogicWorks 4 Tutorials (5/15/03) Page 1 of 14

ROUND(cell or formula, 2)

Design Projects in a Programmable Logic Controller (PLC) Course in Electrical Engineering Technology

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

ALLIED PAPER : DISCRETE MATHEMATICS (for B.Sc. Computer Technology & B.Sc. Multimedia and Web Technology)

Modbus RTU Communications RX/WX and MRX/MWX

PLC Programming for Industrial Automation. Kevin Collins

RSLogix500 Project Report

Experiment # 9. Clock generator circuits & Counters. Eng. Waleed Y. Mousa

Understanding the IEC Programming Languages

How To Use The Powerpoint 3.5 On A Computer With A Powerpoint 2.5 (Powerpoint) On A Pc Or Macbook 2.2 (Powerstation) On An Iphone Or Ipad (Powerplane)

Multifunction devices

Debouncing Switches. Mechanical switches are one of the most common interfaces to a uc.

3.Basic Gate Combinations

Decimal Number (base 10) Binary Number (base 2)

COMBINATIONAL CIRCUITS

Take-Home Exercise. z y x. Erik Jonsson School of Engineering and Computer Science. The University of Texas at Dallas

Gates, Circuits, and Boolean Algebra

Custom Solutions Center. Users Guide. Low Cost OEM PackML Templates L02 Release. Version LC-1.0

Quick Start Tutorial. Using the TASKING* Software Development Tools with the Intel 8x930 Family Evaluation Board

DeviceNet Bus Software Help for Programming an Allen Bradley Control System

Asynchronous Counters. Asynchronous Counters

Assembly Language Programming

PIC Programming in Assembly. (

Transcription:

5: Ladder Logic - NOTES TOPIC 1: Relay Logic Before going forward, review how a relay works here. Now that you understand the relay function let s look at the way in which relays are typically drawn in relay logic. Below is a seal circuit or a start/stop circuit. It is one of the most common circuits used in machine control. Both the start and stop switches are momentary which means they return to their normal state after you push them. The stop button is normally closed and the start button is normally open. There is one relay in the circuit consisting of both a relay coil and a relay contact. The contact is normally open. When the start button is pushed it allows current to flow through the relay coil and forces the relay contact to become closed. Once the relay contact is closed there is an alternate path around the start button for current to flow so that when the button returns to its open position the current can flow through the contact and around the switch. When the stop button is pressed it interrupts current flow to the circuit and must be restarted again with the start button. TOPIC 2: Ladder Logic Symbols There are three main symbols we will use to begin with. These are the Normally Open (NO) Contact (also called the XIC Examine if Closed), the Normally Closed (NC) Contact (also called the XIO Examine if Open), and the output. Normally Open Contact (XIC) Address I:0/1 input 1 Normally Closed Contact (XIO) Address I:0/3 input 3 Output Address O:0/0 output 0

With these three components, we can create the seal circuit in a ladder logic program. The first step is to realize that there are no switches inside the PLC, but instead a contact can be associated to an input and the switches can be wired to an input. For example, if a Stop Button was wired to input 1 and a Start Button was wired to input 2 the seal circuit might look light the following inside the PLC program. In this program, a light is wired to output 0 (address O:0/0) and comes on when the start button is pressed. Additionally, there is a normally open contact associated with the light that will close when the output with the same address is on. So in this example, when input 1 (the stop button) and input 2 (the start button) go on, output 0 turns on and changes the state of the normally open contact called light. At this time there is now provided an alternate path for current to flow around input 2 (the start button). It is assumed that the externally wired stop button is normally closed and therefore I:0/1 is on (and the contact is closed) as long as the stop button is not pushed. This program represents one rung of ladder logic code. Each level in the program is referred to as a rung like in a normal ladder. The lines that contain the program from the left and right are called rails. TOPIC 3: Timers Think of a timer in ladder logic as a traditional egg timer. You set it for a certain amount of time and when the time is up something happens. In order to accomplish this in the PLC, the timer uses up three words of memory. They are: 1. Word 0 Timer Timing (bit), Timer Done (bit), Timer Enabled (bit), (the remaining 13 bits are for internal use) 2. Word 1 Preset (word) 3. Word 2 Accumulator (word) There are three bits within word 0 that require further explanation 1. Timer Timing This bit is on if the timer is currently timing. That is the timer has been started and it has not yet reached its final time. 2. Timer Done This bit is on if and when the timer reaches its final time. This is the ding when the egg timer has reached zero. 3. Timer Enabled This means that the timer has power and is capable of working. It may be timing or already done, but it has power. Furthermore, there are two other pieces of memory that require further explanation 1. The Preset The preset value is the time that the timer is timing to. It s just like setting the egg timer for 15 minutes. 2. The Accumulator This is the current amount of time that has passed since the timer started timing. When the accumulator reaches the preset the timer done bit comes on. Each of these pieces of memory have their own address but first let s discuss the timer address. The program can have many timers, each with its own general address T4:0, T4:1, T4:2, etc. This address should be considered the overall timer address. Down a bit deeper inside the timer there exist separate addresses for each part of the timer. We will assume that the overall timer address being used below is T4:3. 1. Timer Timing T4:3/TT or T4:3/14 2. Timer Done T4:3/DN or T4:3/13 3. Timer Enable T4:3/EN or T4:3/15 4. Timer Preset T4:3.PRE or T4:3.1 5. Timer Accumulator T4:3.ACC or T4:3.2

One more important piece of information is the time base by which the timer is timing. There are three options here, 0.001 seconds (1mS), 0.01 seconds (10mS), and 1 second. In other words the accumulated value is interpretted as time only when the time base is known. If the accumulator is currently 324, it could mean 0.324S, 3.24S, or 324S depending on the selected time base. There are three main types of timers 1. Timer, On-Delay (TON) Works as described above. 2. Timer, Off-Delay (TOF) Basically works the opposite of the above description. 3. Retentive Timer (RTO) Works just like the TON but retains its accumulator even when disabled. Here is an application of timers. First, observe that the first rung of code is the same as above with the exception that the start button is now wired to input 0. Also notice the rung number off to the left of the diagram. This program contains rungs 0 through 5. There are two timers here, T4:0 and T4:3 each have a name given to them by the programmer, TIMER1 (T4:0) and TIMER2 (T4:3). Each are set to a time base of 0.01S. TIMER1 has a preset of 12,000 and TIMER2 has a preset of 18,000. Once the start button is pushed and the LIGHT goes on, the first contact on rung 1 closes (because it s associated with output 0, the LIGHT). The second contact on rung 1 is normally closed. It remains closed until TIMER2 is done timing. Therefore, as soon as output 0 (O:0/0) turns on TIMER1 begins timing. As soon as it reaches its preset time, 120 seconds, the contact on rung 2 comes on and starts TIMER2. Continuing to rung 3 while TIMER1 is timing (that is, after the LIGHT is on and for 120 seconds after that) output 1 (O:0/1) is on. Similarly, while TIMER2 is timing (after TIMER1 is done and for 180 seconds after that) output 2 (O:0/2) is on. At any time during operation, if the STOP button is pushed, causing the first contact in rung 0 to open, every rung is disabled, all timers reset, and all of the outputs are off. When a TON timer is disabled (current cannot get to it because a contact is open) it looses count and is reset back to zero.

TOPIC 4: Counters Counters are similar to timers but instead of timing the passing of time they count events such as products passing on a conveyor or the number of bad parts rejected from a system. Counters also consume three words of memory as follows. 1. Word 0 Count Up (CU), Count Down (CD), Done (DN), Overflow (OV), Underflow (UN) (the remaining 11 bits are for internal use) 2. Word 1 Preset (word) 3. Word 2 Accumulator (word) There are five bits within word 0 that require further explanation 1. Count Up (CU) This bit is on if the counter is set to count up. 2. Count Down (CD) This bit is on if the counter is set to count up. 3. Done (DN) This bit is on if and when the counter reaches its preset. 4. Overflow (OV) This bit is on if the count goes above the highest number able to be represented in the accumulator, 32,767. 5. Underflow (UN) This bit is on if the count goes below the lowest number able to be represented in the accumulator, -32,767. Furthermore, there are two other pieces of memory that require further explanation 1. The Preset The preset value is the value that the counter is counting to. 2. The Accumulator This is the current count that the counter has counted to. When the accumulator reaches the preset the done bit comes on. Each of these pieces of memory have their own address but first let s discuss the counter address. The program can have many counters, each with its own general address C5:0, C5:1, C5:2, etc. This address should be considered the overall counter address. Down a bit deeper inside the counter there exist separate addresses for each part of the counter. We will assume that the overall counter address being used below is C5:3. 1. Count Up (CU) C5:3/CU or C5:3/15 2. Count Down (CD) C5:3/CD or C5:3/14 3. Done (DN) C5:3/DN or C5:3/13 4. Overflow (OV) C5:3/OV or C5:3/12 5. Underflow (UN) C5:3/UN or C5:3/11 6. Preset C5:3.PRE or C5:3.1 7. Accumulator C5:3.ACC or C5:3.2 There are two types of counters 1. Count up (CTU) Counts from zero up to the preset value. 2. Count Down (CTD) Counts down from the preset to zero. Because counters always retain their count (because they are always enabled), there is another command we have to reset the current accumulated value. This is the RES command. The command looks like an output except you give it the address of the counter you wish to reset when the output is on. The RES command works to reset a timer also. Here is an application of counters. Notice the rung number off to the left of the diagram. This program contains rungs 0 through 8.

First, there is a sensor (really a switch) connected to input 0. This contact, on rung 0, comes on and back off again every time a product passes on a conveyor. The counter C5:0 (COUNTER1) counts these products as they pass. Once 100 products are counted the DN bit comes on and the contact on rung 1 closes. This causes OUTPUT0 (O:0/0) to come on. Additionally, the contacts on rungs 2 and 3 come on and cause COUNTER2 (C5:1) to count. It also starts a timer that times for 100mS. Once the timer is complete rung 4 countact T4:0/DN comes on and resets COUNTER1 (C5:0). Once this process occurs 4 times (400 parts have passed) the second counter, C5:1, reaches its preset. This turns on an output, O:0/1, on rung 5 and starts a 250mS timer on rung 6. Once this timer is complete, COUNTER2, C5:1, is reset on rung 7. TOPIC 5: Other Common Ladder Logic Commands There are a series of other commands that you will need to understand for use in the lab. Math Commands 1. ADD Takes two values and adds them together. Can be constant values or an address in memory. 2. SUB- Takes two values and subtracts them. Can be constant values or an address in memory. 3. MUL- Takes two values and multiplies them together. Can be constant values or an address in memory. 4. DIV- Takes two values and divides them. Can be constant values or an address in memory. 5. ABS Takes the absolute value of a value in memory. 6. CLR Clears, or sets to zero, an address in memory. 7. NEG Takes the negative of a number.

Logic Commands 1. AND The traditional AND logic function. 2. OR- The traditional OR logic function. 3. NOT- The traditional NOT logic function. 4. XOR- The traditional XOR logic function. Move Commands 1. MOV Move a piece of memory to a new location in memory. 2. MVM Move a piece of memory to a new location in memory after applying a mask to the data. Just like a mask you can only see a part of what is behind the mask. If the bit in the mask is a 1 then the data is moved, if the mask is a 0 the data is not moved, but ignored. Subroutine Commands 1. JMP Jump to a label somewhere else in the program. 2. LBL A label to which the JMP command can jump. 3. SBR Subroutine label. 4. JSR Jump to a subroutine label. 5. RET Return from a subroutine. 6. END Program end. You should now be prepared to answer the following questions. 1. The seal circuit is also called the. 2. XIC stands for. 3. XIO stands for. 4. The sides of a ladder logic program are called. 5. Each level of a ladder logic program is called a. 6. The three words a timer uses are. 7. What is the difference between TON and RTO? 8. In the timer application, how long in seconds is it between the time you push the start button until the timer 2 light comes on? 9. What is the address of the TIMER1 Accumulator? 10. In the counters application, when the outputs come on how long are they on? 11. What is the address of the COUNTER1 Done bit? 12. A MVM is used to move 16 bits, 0110100111011011, the mask used is 1111000011110000. What is the data that is moved in hexadecimal? 13. Complete the Ladder Logic Game. You ll have to click next upon entry to the game. If you hit a score of 2000 you are guaranteed an 80%, after that you are competing with your peers. The highest score gets 100%. To determine other grades (if your score is greater than 2000) I will take 80+ (your score-2000) x (20/((the highest score) 2000)). If your score is less than 2000 your grade will be (80/2000)x(your score).