LADDER LOGIC/ FLOWCHART PROGRAMMING DIFFERENCES AND EXAMPLES



Similar documents
Programming A PLC. Standard Instructions

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

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

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

Introduction to LogixPro - Lab

Programmable Logic Controllers

Fig 3. PLC Relay Output

(Cat. No L3) Product Data

3BASIC RELAY INSTRUCTIONS

Analog Inputs and Outputs

Programming Logic controllers

Programmable Logic Controllers Definition. Programmable Logic Controllers History

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

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

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

SECTION 13XXX CONTROL DESCRIPTION (DICP Models NC, 412, 622, 826, 1030)

11. FLOWCHART BASED DESIGN

PROGRAMMABLE LOGIC CONTROL

Automating witfi STEP7 in LAD and FBD

Training Manual for Cscape and XLe

Automating with STEP7 in LAD and FBD

S7 for Windows S7-300/400

NTE2053 Integrated Circuit 8 Bit MPU Compatible A/D Converter

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

WinProladder User Guide Content

Modbus RTU Communications RX/WX and MRX/MWX

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

First Steps with CoDeSys. Last update:

Programmable Logic Controllers

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

SIMATIC. WinCC V7.0. Getting started. Getting started. Welcome 2. Icons 3. Creating a project 4. Configure communication 5

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

Software Manual RS232 Laser Merge Module. Document # SU Rev A

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

Programmable Logic Controller PLC

CHAPTER 11: Flip Flops

Training Document for Comprehensive Automation Solutions Totally Integrated Automation (T I A) MODULE A5 Programming the CPU 314C-2DP

Digital Systems Based on Principles and Applications of Electrical Engineering/Rizzoni (McGraw Hill

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

Electrical Symbols and Line Diagrams

MICROPROCESSOR AND MICROCOMPUTER BASICS

FC5A Modbus Communication Training

How to read this guide

CHAPTER 11 LATCHES AND FLIP-FLOPS

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

LiteKeeper 4 & 8 Programming Guide and User Manual

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

CHAPTER 7: The CPU and Memory

Modeling Sequential Elements with Verilog. Prof. Chien-Nan Liu TEL: ext: Sequential Circuit

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Traditional IBM Mainframe Operating Principles

ABB i-bus EIB Logic Module LM/S 1.1

Timer Value IRQ IACK

The following shows the symbols used in this Quick start guide with descriptions and examples. Symbol Description Example. Select [Project] [New].

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

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

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

An overview of Computerised Numeric Control (C.N.C.) and Programmable Logic Control (P.L.C.) in machine automation

Non-Isolated Analog Voltage/Current Output module IC695ALG704 provides four configurable voltage or current output channels. Isolated +24 VDC Power

Ethernet/IP Explicit Messaging Using Unity Software

Technical Manual. FAN COIL CONTROLLER COOLING or HEATING ANALOG or PWM Art A

Microprocessor & Assembly Language

PART B QUESTIONS AND ANSWERS UNIT I

Timer A (0 and 1) and PWM EE3376

Chapter 2 Logic Gates and Introduction to Computer Architecture

PAC1 Door Access Controller

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

SYMETRIX SOLUTIONS: TECH TIP May 2014

SHORT TRAINING COURSES

MBP_MSTR: Modbus Plus Master 12

Ladder and Functional Block Programming

DeviceNet Bus Software Help for Programming an Allen Bradley Control System

SECTION CONTROL SOFTWARE

Small Hardware Development and Prototyping Board for the SX28

How To Use Safety System Software (S3)

ABB i-bus EIB Universal Interfaces US/U 4.2 US/U 2.2

An Introduction to MPLAB Integrated Development Environment

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

Sequential Logic. (Materials taken from: Principles of Computer Hardware by Alan Clements )

The Case for Intelligent Remote I/O. The Case for Intelligent Remote I/O. Wise Delegation for Your Automation System. Introduction

SIMATIC. System Software for S7-300 and S7-400 Program Design A B C D. Programming Manual C79000-G7076-C Preface, Contents

Straton and Zenon for Advantech ADAM Copalp integrates the straton runtime into the ADAM-5550 device from Advantech

Chapter. Getting Started. In This Chapter...

Technical Training Module ( 30 Days)

SNAP-SCM-PROFI Communication Module

The Old Brewery Works, Lr Ellacombe Church Rd, Torquay. UK. TQ1 1JH Tel: Fax:

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

Modbus and ION Technology

Using the JNIOR with the GDC Digital Cinema Server. Last Updated November 30, 2012

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

Siemens S7 Status Word

2.0 System Description

Procidia Control Solutions Dedicated Backup in a Single Variable Control Loop

Creating Datalogging Applications in Microsoft Excel

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

DME4 V1.23 ( ) V1.30 ( ) V1.31 ( ) V1.32 ( ) V1.33 ( ) V1.34 ( ) V1.35 ( ) V2.00 ( ) V2.

EnerVista TM Viewpoint Monitoring v7.10

Chapter 8: Ladder Logic Language Reference

for both the Verbatim Gateway and Catalyst Autodialer EtherNet Options

Transcription:

page 1/10 This document is designed as a quick-start primer to assist industrial automation programmers who are familiar with PLCs and Relay Ladder Logic programming to better understand the corresponding principles and techniques for constructing programs. Also refer to document entitled Solution Provider White Paper - A Comparison of PLCs and ladder logic vs. Opto 22 s hardware and software. Control Basics A control program in any language is simply a series of questions and commands. However, the way in which RLL and allows the programmer to organize these questions and instructions differ radically. RLL - The Scan and Rungs There are fundamental differences in the methods in which PLCs and Opto controllers interact with their I/O systems. PLCs are scan-based processors: that is the cycle for solving logic is performed by reading all the inputs, processing user logic (solve the rungs), and then writing the outputs and updating registers. In RLL a question/command operation is represented by the rung. The left-hand side of the rung looks for a specific condition and the right hand side performs the required action. Programs are assembled by creating many of these rungs and then getting them to execute in the proper sequence. Due to the PLC s scan-based logic solve method, RLL requires the programmer to think about the control process in a parallel fashion. That is, the programmer must remember that all the questions are being asked with every program scan. Opto 22 - Immediate Mode and Flowcharts All instructions in operate in immediate mode and only the data required at that point in the code is accessed. When the processor is instructed to see if a switch is on, it immediately reads the input and when instructed to turn on an output, it immediately does so. This allows the programmer to focus on the sequence steps without regard to the rest of the program data. is a flowchart-based programming tool that allows the user to design the question/command control logic using a combination of four high-level constructs: Action Blocks - Rectangles that contain a list of command instructions. Actions may have many entrances, but only one exit. (i.e. Turn On, Turn Off, and Start Timer) Condition Blocks - Diamonds that contain a list of questions that are used to direct logic flow. Conditions may have multiple entrances and two exits: TRUE is all questions test true and FALSE if any of the questions test FALSE. (i.e. On?, Greater Than?, and True?) Continue Blocks - Ovals provide the ability to jump to Action or Condition blocks. They contain the name of the destination block. They are used to improve chart readability. Connections - Lines with arrows that connect the blocks together in the desired logic flow sequence.

page 2/10 English-based commands are then inserted into these constructs to provide the detailed program instructions. As many blocks as needed are assembled into the proper sequence to create a Chart that controls a specific aspect of the process. A real-time multitasking operating system provides the ability to run many charts simultaneously. An program or strategy is constructed by breaking the process operation into logical segments, designing charts to control each segment, and then running the charts in the desired control sequence. Control Options Unlike the typical PLC where the majority of logic execution is performed by the processor, there are three basic ways that control can be executed in an Opto system: 1. Processor Control The first is by the host processor solving the flowchart in an event-driven manner. There is no PLC-like scan on Opto controllers. The logic is solved sequentially as the code is executed. The inputs are polled and outputs are updated as needed in a command and response (processor to I/O) fashion. This arrangement is highly efficient because the only I/O being read or written is that which is necessary to solve a particular section of code. The processor does not waste time manipulating I/O that is not part of the current process sequence. 2. On-Board I/O Intelligence The second way control is executed on an Opto system is by the intelligent I/O brain boards that act as local controllers on each I/O unit. Each brain board has its own microprocessor and custom ASIC to provide local control functionality. No programming is required to use most of these functions. It is simply a matter of configuring the input or output to enable the underlying control features. Thermocouple inputs for example are linearized and converted to degrees in Centigrade or Fahrenheit by the brain board. When the processor reads the input, there is no additional host processing needed to obtain the temperature. Other functions are enabled by selecting the appropriate function from the Features list box when a point is added to the program. 3. Event/Reactions An event/reaction is a powerful and unique feature that allows users to off-load or distribute control logic to an intelligent I/O brain board. That is, some of the logic in a strategy can be run on the I/O unit independently of the controller. As the name suggests, an event/reaction consists of an event and a corresponding reaction. Each time an event becomes true, its corresponding reaction is executed once. The event is a user-defined state that the I/O unit can recognize. The defined state can be a combination of values, inputs, and outputs. On a digital multifunction I/O unit, for example, any pattern of input and output states (on and off) can constitute an event. On an analog I/O unit, an event could occur when an input channel attains a reading greater than a selected value. Examples of reactions include turning on or off a set of outputs, ramping an analog output, and enabling or disabling other event/reactions. Intelligent I/O also has the capability to react to a specified event by generating a hardware interrupt at the host through a separate communication link. When the host processor receives an interrupt, it usually starts a suspended task called the Interrupt Chart, where user-defined logic in that chart is immediately executed. This is can be extremely useful for handling alarm conditions and situations where an event on one I/O unit must quickly cause a reaction on another I/O unit.

page 3/10 Control Options (cont.) Event/reactions are stored in each I/O unit. As soon as power is applied to the I/O unit, all event/reactions for which scanning is enabled are scanned continuously in the same order in which they were configured in. Since each I/O unit can be configured with up to 256 event/reactions, complex tasks and sequences can be performed. Files, Addresses and Tagnames One of the primary differences between RLL and is the way program data is organized and accessed. RLL segments program information into files in memory with each file type having a specific function. Addressing is then used to get at specific data within each file. Addressing is a combination of the file type and the register location within the file. For example, Allen Bradley PLCs use the following address convention: F8:100 means - file F8 (File 8 or Floating Point file) at register 100. All program data is then manipulated by specifying the necessary file address and item (register, bit, etc.). abstracts control data by allowing the user to provide descriptive tagnames for all data elements. Understanding how low level memory storage operates is not necessary because configuring and manipulating data is transparently handled by. To create a floating point variable, the programmer pulls down the Configure Variable menu, selects Float and gives it a name. All access to that variable is provided by referencing the tagname. Mnemonic Instructions and Commands In Relay Ladder programming functions such as reading inputs and writing output, timers and counters are handled by Mnemonic Instructions. Unless special I/O modules are used (i.e. Hardware Counter) these functions are performed in software by the PLC s processor. With Opto 22 systems, many of these functions are imbedded into the intelligent I/O and accessed by Action or Condition Block commands. For example any intelligent input can act as a high-speed counter and count asynchronously from the host processor. Understanding how these functions are implemented will allow the programmer to take advantage of the added I/O features and benefits. Please take a look at the Overview chapter in the Command Reference manual for more detailed explanations on using these features. We will examine a typical PLC s implementation of these instructions and then explain how each is accomplished with Opto 22 control systems. Digital Inputs and Outputs RLL Inputs and internal registers used as control bits are placed on the left-hand side of the rung and evaluated with the - - symbol (read as Examine if Closed) and the - / - symbol (read as Examine if Open). In RLL the -( )- symbol represents an output coil. Coils toggle bits in memory locations and are used to control physical outputs and internal registers. Coils are placed on the right-hand side of a rung and are only executed if the input logic on the left-hand side of the rung is True.

page 4/10 Mnemonic Instructions and Commands (cont.) The status of inputs is evaluated by using a condition block with the On? or Off? instruction. Controlling outputs is accomplished by using an Action block with the Turn On or Turn Off command. One of the major differences in controlling I/O between RLL and is that all Outputs and Variables are retentive and hold their state until instructed to change. Analog Inputs and Outputs Analog I/O is handled much in the same way with both systems. To read I/O status, mathematical compare functions are used (i.e. Equal, Greater Than, Less Than, etc.). If analog information needs to be logged to memory or transferred from an input to an output, the Move instruction is used. Writing analog outputs is also similarly handled with the Move instruction. Analog outputs are always retentive. Latches RLL A latch in RLL is an output function. It is used to make digital outputs and internal registers retentive. The output holds its state until changed using an unlatch instruction. Latches in are hardware input functions executed by the intelligent I/O units. Latches are used to sense momentary high-speed signals. If a latch is enabled, it will read False until it sees a transition. Once the input sees a pulse, it will read True until it is cleared. Examples Included are a few examples of common PLC programs and a corresponding flowchart program. Timers and Delays As the name indicates, Timers are used to measure the time period between two events. In RLL, Timers are also used to provide pauses between logic steps. provides Timers and also the Action Command Delay for logic pauses, which is more efficient than a Timer. RLL Timers are implemented as instructions in RLL and typically work by counting up from zero to a user-defined value. They are treated as output devices and are placed on the right-hand side of a rung. Configuration RLL timers typically have two configuration settings: Time Base - timer resolution typically in seconds, and the Preset - number of timer ticks (in time base resolution) to count. Total Timer Duration = Time Base x Preset.

page 5/10 Using PLC Timers An RLL timer starts counting as soon as the rung circuit it is placed in becomes true. There are typically two runtime parameters used to utilize timers: Timer Done - a bit that is set TRUE when the timer has finished, and the Accumulator - a register that is used to check the current number of counts. Some RLL implementations also have a CLR or Clear Accumulator instruction that allows the Timer s Accumulator to be reset during program execution. Timers Timers in are a special type of Numeric Variable and work by Moving a number (float or integer) into them. The timer then counts down from that number and stops when it reaches zero. Configuration Timers are created in by selecting Timer from Type list box in the Add Variable dialog. Timers are measured in seconds with 1 millisecond resolution and offer a range of 0.001 to 4.611686 x 1015 seconds. Using Timers A timer is automatically started by using the Move command to place the desired time value into the timer variable. Any command that references numeric variables can be used to examine or manipulate timers. The Timer Expired? condition command is used to determine when the timer has finished and tests True when the timer reaches zero in its countdown. Delays The Delay Action command in can be used in place of a Timer to provide a time-specific pause between logic steps. This command provides better processor efficiency and is simpler to implement than a timer.

page 6/10 RLL Timer and Delay Comparison A simple application requires that an output is turned on 3 seconds after an input closure. This example shows how an RLL timer and the Delay command provide the 3-second delay. Relay Ladder Logic Step 1 Look for Start_Sw itch Input Closure Step 2 Start 3 Second Timer R8 Start_Switch I:0.0 1 TON Timer On D elay Timer T4:3 Timer Base 0.01 Preset 300 Accum 0 EN DN T4:3 Run_Lamp O:1.0 R9 DN Step 3 Look for Timer Done Bit to become TRU E 2 Step 4 Turn On Run_Lamp Output Is On? Start_Switch Delay (Sec.) Turn On 3.0 Run_Lamp

page 7/10 RLL and Timer Comparison This example illustrates the use of Timers to measure the time between two events. A timer is utilized to measure how long it takes a Widget tester to check a part. Relay Ladder Logic Step 1 Look for Test_Start Bit To Go TRUE Step 2 Start Part_Test Timer R20 Te st_s ta rt B3 1 TON Timer On Delay Timer T4:4 Timer Base 0.001 Preset 1000 Accum 0 EN DN R21 Test_C omplete B3 2 Step 3 Look for Test_Complete Bit to become TRUE MOV Move Source T4:4.Acc xxx Dest N7:0 Step 4 M o ve P art_test Tim er accumulated time into integer Is Variable True? Test_Started Move From 10000 To Part_Test_Timer Is Test_Complete Variable True? Subtract Minus Put Result In 10000 Part_Test_Timer Test_Time Note: Timers count down from a preset. To obtain the expired time, subtract the current time from the original preset.

page 8/10 Counters RLL Counters Counters typically come in two types: a Count Up and a Count Down. They are treated as output devices and are placed on the right-hand side of a rung. Configuration RLL Counters typically have one configurable setting: Preset - the desired number of counts to trigger the Done bit. Using PLC Timers There are typically four runtime parameters used to utilize counters: 1. Counter Done Bit - set TRUE when the Preset has been reached. 2. Enable Bit - follows Rung - set True when the Rung is True and False when rung is False. 3. Overflow (Count Up) and Underflow (Count Down) Bit - Overflow Bit is set True when Accumulator reaches the positive Counter limit on an Count Up counter. Underflow Bit is set True when Accumulator reaches the negative limit of possible Counter values on a Count Down counter. 4. Accumulator - a register used to hold the current number of counts. Some RLL implementations also have a CLR or Clear Accumulator instruction that allows the Counter s Accumulator to be reset during program execution. A Count Up Counter starts with the Accumulator set to 0. For each On to Off transition, the Accumulator is then incremented by one. The Done bit is set when the number of counts in the Accumulator equals the Preset. A Count Down Counter starts by first moving the Preset into the Accumulator. For each On to Off transition, the Accumulator is then decremented by one. When the Accumulator reaches 0, the Done bit is set.

page 9/10 Counters Counters Counters in are implemented by intelligent I/O. Counters start from 0 and count up. Configuration Counters are created in by selecting Counter from the Features list box in the Add Digital Point dialog. Although the input now has the Counter feature enabled, the On?, Off?, and Latch commands that operate on regular digital inputs are always available. Using Counters A Counter is manipulated with six commands: 1. Start Counter - starts counter with no effect on previously accumulated counts 2. Stop Counter - stops counter with no effect on previously accumulated counts 3. Get Counter - moves current accumulated counts to a variable 4. Clear Counter - resets counter to 0 with no effect on Counter run status 5. & 6. Get and Clear Counter - moves current accumulated counts to a variable and clears the counter. In addition to these Counter only commands, any counter can be accessed directly via many of the common Variable and I/O commands. For example, a counter can be tested for a desired value by using the Is Equal? Condition command or the current input status can be checked using the On? command.

page 10/10 RLL and Counter Comparison An application requires that an output is turned on after a push button has turned on and off 10 times. This example shows how use a RLL Counter and an Counter to count the button pushes. Relay Ladder Logic Step 1 Look for Counter_Button Input Closure Step 2 Start 10 Pulse Counter R8 Counter_Button I:0.2 1 CTU Count Up Counter C5:0 Preset 10 Accum 0 CU DN C5:0 Done_Lamp O:1.2 R9 DN Step 3 Look for Counter Done Bit to becom e TRUE 2 Step 4 Turn On Done_Lamp Output Start Counter On Point Counter_Button Turn On Done_Lamp Is Counter_Button Equal? To 10 Dimensions and specifications are subject to change. All products and/or company names throughout this document are generally trademarks or registered trademarks of their respective companies.