INTRODUCTION In this lesson, we will analyze the different kinds of PLC programming focusing, in particular, on the LAD and STL programming method.

Similar documents
To design a sequential logic circuit using D-Flip-flop. To implement the designed circuit.

Chapter. Synchronous Sequential Circuits

CHAPTER1: Digital Logic Circuits

USCG Exam questions related to PLCs by Frank Owen, Maine Maritime Academy, 23 October 2018

Chapter 6. Flip-Flops and Simple Flip-Flop Applications

UNIT III. Combinational Circuit- Block Diagram. Sequential Circuit- Block Diagram

ECE 301 Digital Electronics

Universidad Carlos III de Madrid Digital Electronics Exercises

Rangkaian Sekuensial. Flip-flop

UNIVERSITI TEKNOLOGI MALAYSIA

Sequential Design Basics

Latches, Flip-Flops, and Registers. Dr. Ouiem Bchir

Section 6.8 Synthesis of Sequential Logic Page 1 of 8

UNIT IV. Sequential circuit

State Transistional Logic

Introduction to Microprocessor & Digital Logic

Lecture 7: Sequential Networks

MODULE TITLE : PROGRAMMABLE LOGIC CONTROLLERS TOPIC TITLES : PROGRAMMABLE FACILITIES AND ADDITIONAL FACILITIES TUTOR MARKED ASSIGNMENT 3

EXPERIMENT: 1. Graphic Symbol: OR: The output of OR gate is true when one of the inputs A and B or both the inputs are true.

The word digital implies information in computers is represented by variables that take a limited number of discrete values.

Spring 2017 EE 3613: Computer Organization Chapter 5: The Processor: Datapath & Control - 1

MC9211 Computer Organization

Name Of The Experiment: Sequential circuit design Latch, Flip-flop and Registers

Chapter 6 Digital Circuit 6-5 Department of Mechanical Engineering

CSE Latches and Flip-flops Dr. Izadi. NOR gate property: A B Z Cross coupled NOR gates: S M S R Q M

Logic Design. Flip Flops, Registers and Counters

Lecture 11: Synchronous Sequential Logic

EMT 125 Digital Electronic Principles I CHAPTER 6 : FLIP-FLOP

Digital Logic Design Sequential Circuits. Dr. Basem ElHalawany

Objectives. Combinational logics Sequential logics Finite state machine Arithmetic circuits Datapath

D Latch (Transparent Latch)

Final Exam review: chapter 4 and 5. Supplement 3 and 4

INDIAN INSTITUTE OF TECHNOLOGY KHARAGPUR NPTEL ONLINE CERTIFICATION COURSE. On Industrial Automation and Control

Sequential Circuits: Latches & Flip-Flops

CHAPTER 4: Logic Circuits

Chapter 5: Synchronous Sequential Logic

0 0/1 0/1 0/1 0/1 0/1 0/1 0/1 0/1 1 1 Stop bits. 11-bit Serial Data format

Introduction. Serial In - Serial Out Shift Registers (SISO)

ELCT201: DIGITAL LOGIC DESIGN

Integration of Virtual Instrumentation into a Compressed Electricity and Electronic Curriculum

CS 261 Fall Mike Lam, Professor. Sequential Circuits

Flip-Flops and Sequential Circuit Design

Unit 11. Latches and Flip-Flops

Other Flip-Flops. Lecture 27 1

Chapter 5 Synchronous Sequential Logic

Training Document for Comprehensive Automation Solutions Totally Integrated Automation (T I A)

Digital Logic Design I

Combinational vs Sequential

Synchronous Sequential Logic

Digital Design, Kyung Hee Univ. Chapter 5. Synchronous Sequential Logic

Engr354: Digital Logic Circuits

AIM: To study and verify the truth table of logic gates

1. a) For the circuit shown in figure 1.1, draw a truth table showing the output Q for all combinations of inputs A, B and C. [4] Figure 1.

Analysis of Clocked Sequential Circuits

Combinational / Sequential Logic

High Speed Counter. Table of Contents

ELCT201: DIGITAL LOGIC DESIGN

Logic Design II (17.342) Spring Lecture Outline


Introduction. NAND Gate Latch. Digital Logic Design 1 FLIP-FLOP. Digital Logic Design 1

CHAPTER 1 LATCHES & FLIP-FLOPS

Logic Design II (17.342) Spring Lecture Outline

DIGITAL SYSTEM DESIGN UNIT I (2 MARKS)

5: Sequential Logic Latches & Flip-flops

Ch 6 Basic Memory Circuits 1

LATCHES & FLIP-FLOP. Chapter 7

MODULE 3. Combinational & Sequential logic

Synchronous sequential circuits

CHAPTER 4: Logic Circuits

Course Administration

Chapter 5 Sequential Circuits

Chapter 3. Boolean Algebra and Digital Logic

SEQUENTIAL CIRCUITS THE RELAY CIRCUIT

ELCT201: DIGITAL LOGIC DESIGN

Flip-Flops. Because of this the state of the latch may keep changing in circuits with feedback as long as the clock pulse remains active.

Sequential Logic Circuits

Synchronous Sequential Logic. Chapter 5

Find the equivalent decimal value for the given value Other number system to decimal ( Sample)

Logic and Computer Design Fundamentals. Chapter 7. Registers and Counters

Logic Design ( Part 3) Sequential Logic- Finite State Machines (Chapter 3)

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

ECE 341. Lecture # 2

Microprocessor Design

INTRODUCTION TO SEQUENTIAL CIRCUITS

Synchronous Sequential Logic

Unit-5 Sequential Circuits - 1

Digital Fundamentals: A Systems Approach

Part II. Chapter2: Synchronous Sequential Logic

EE292: Fundamentals of ECE

Experiment # 9. Clock generator circuits & Counters. Digital Design LAB

FLIP-FLOPS AND RELATED DEVICES

Computer Systems Architecture

NH 67, Karur Trichy Highways, Puliyur C.F, Karur District UNIT-III SEQUENTIAL CIRCUITS

First Name Last Name November 10, 2009 CS-343 Exam 2

Chapter 4. Logic Design

Solution to Digital Logic )What is the magnitude comparator? Design a logic circuit for 4 bit magnitude comparator and explain it,

Figure 30.1a Timing diagram of the divide by 60 minutes/seconds counter

Serial In/Serial Left/Serial Out Operation

Sequential Circuits. Output depends only and immediately on the inputs Have no memory (dependence on past values of the inputs)

St. MARTIN S ENGINEERING COLLEGE

Transcription:

INTRODUCTION In this lesson, we will analyze the different kinds of PLC programming focusing, in particular, on the LAD and STL programming method. PLC PROGRAMMING METHOD During the process of programming, the PLC uses an interface between the operator, who has to organize the logic of control, and the CPU in the controller. This interface will allow the operator to translate the process into a series of codes equivalent to the expression of Boolean logic equations that the controller will use to determine the value of the outputs according to the value of the inputs. Each manufacturer uses its own programming ambient and also the instructions available can be different depending on the PLC used. The international organization IEC (International Electrotechnical Commission) introduced a standard that allows an easier convergence between the various manufacturers in the development of software for programming. The reference standard, IEC 1131, was taken by the European Community with EN 61131 and reported by the Italian standard CEI 65-40. IEC defines the five different programming languages: PROGRAMMING LANGUAGES Ladder Diagram (LD) GRAPHICS Function Block Diagram (FBD) Sequential Function Charts (SFC) TEXTUAL Instruction List (IL) Structured Text (ST) The appearance is the characteristic that differentiates them according to the different languages. The first three languages are defined graphics and they are based on a software that allows the operator to program the PLC by means of the construction of charts and graphs that are modeled on the structure of the ladder diagrams of the electromechanical circuits or the electric schemes of the integrated logic circuits. The other two languages are defined textual since they are based on a purely textual language of low or high level depending on the type adopted. The programming ambient allows you to mix programming languages adopted internally to a project in order to exploit the peculiarities of each of them. Each manufacturer also states the names of the addresses of the PLC elements and gives this information to the operators in order to prepare the correct signals in the programming. The table below can give you an idea of the diversity that exists between the various manufacturers and will allow a better understanding of the examples that will be reported later in the coverage of various programming languages. Commission. 1

Operating method of the PLCs SIEMENS S7 300 (CPU 314C-2 DP) SIEMENS S7 200 (CPU 226) OMRON CJ1M (CPU 21) No from to No from to No from to Digit. inputs 24 E124.0 E126.7 24 Digit. outputs 16 A124.0 A125.7 16 Internal relays (memories) I0.0 I1.0 I2.0 Q0.0 Q1.0 I0.7 I1.7 I2.7 Q0.7 Q1.7 10 000 009 6 100 105 2048 M0.0 M255.7 256 M0.0 M0.255 1000 1015 Counters 256 Z0 Z255 256 C0.0 C0.255 512 CNT000 CNT511 Timers 256 T0 T255 256 T0.0 T0.255 512 TIM000 TIM512 LADDER DIAGRAM (LD) The Ladder Diagram (LD) also called contacts language, or KOP, is a graphical language which is composed of a sequence of branches formed by a decision part (contacts) on the left and an implementation part (coils) to the right between the two lines of vertical power. This arrangement generates a graphical representation of the structure that resembles a ladder. Its name derives from this similarity. The Ladder Diagram is a programming method which reproduces the patterns made in electromechanical circuits and it s based on a flow of electrical current that activates the coils only when the conditions of the contacts, in the decision-making part, allow the passage. The IEC 1131 also provides that this current flow is assumed from left to right in the rung and that the logic is executed from top to bottom, thus increasing the value of the order of the rungs. The programming language was invented to make the control logic using the PLCs. Before this systems the control logic was done using electromechanical relays. The decision block is equivalent to the logical expression that determines the activation of the output coil (internal or external) and it s formed by a combination of logic elements (AND, OR, NOT) made following a ladder diagram. In correspondence with the contacts and coils will be indicated the addresses of the elements they represent. Commission. 2

The symbols used for programming are: SYMBOL TYPE OPERATION Normally open contact (N.A.) Normally closed contact (N.C.) Monostable coil Bistable latching coil (SET) Bistable latching coil (RESET) INPUT The contact current passes if the associated input has the value 1 INPUT The contact current passes if the associated input is 0 OUTPUT It is activated and remains active only when the logical conditions of the contacts ensure electrical continuity OUTPUT It is activated when the logic conditions of the contacts ensure electrical continuity OUTPUT It turns off if the logical conditions of the contacts ensure electrical continuity Connection in series Logic function AND Parallel connection Logic function OR Timer It sets output with a lag (TV) compared with insertion conditioning (Start). Sometimes there is a reset input (Stop) Bidirectional meter It enables the output when the count reaches the set value (PV). It has a channel to increase the value (Up), one for the decrease (Down) and one for the Reset Commission. 3

Let's see some examples of KOP: Siemens S7: Q0.0 is activated when the signal is present at the input I0.0 Siemens S7: the output Q0.1 is activated when signals are present simultaneously at the input I0.0 and I0.1 Siemens S7: the output Q0.1 is activated when the input signal is present at I0.0 and it simultaneously absent at I0.1 Omron: the output 200 is activated when or the input signal 010 or the input signal 002 is present. Omron: the output 100 is activated when, or the input signal 010 is present, or the input signal 002 is absent. Omron: the output 100 is activated when the signal is present at 010 or absent at 004 and, at the same time, signal is absent at 002 or it s present at 005. Omron: the output 100 is activated when the signal is present at 010 and it s absent at 002, or when the signal is absent at 004 and it s present at 005. FUNCTIONAL BLOCK DIAGRAM (FBD) The functional block diagrams are a graphical programming language. This language is based on a representation of the laws of the activation of outputs obtained by passing the signals (conditions) through graphic blocks interconnected and each equipped with specific rules of transformation of the signal. Each functional block has, therefore, two main characteristics: the type of data input and output and the algorithm that, analyzing the value of the inputs and the internal variables, produces the new values of the outputs. This programming method is based on three fundamental syntactic rules: - No item should be analyzed before the values of all its inputs are acquired; - The evaluation of an item will not be complete until you have determined the values of all its outputs; - Overall assessment of the network ends when all outputs of all its elements are determined. Commission. 4

An example of the FBD programming can be shown in the diagram below: I0.0 I0.1 I0.2 I0.3 & 1 1 Q2.5 The output Q2.5 is activated when there are signals simultaneously at I0.0 and I0.1 or when the signal is present at I0.3 or it s absent at I0.2 SEQUENTIAL FUNCTION CHARTS (SFC) The sequential function chart is based on a graphical representation of the process through a sequence of phases (within which you perform the actions), linked between them by transitions (which, on the occurrence of certain conditions, will switch from an active phase to another). This method of programming gives a general view of the system and allows you to create sequences of stages in parallel or possibly with priorities and to insert sequences of feedback. It does not allow you to program in specific phases or transition conditions, so it must be carried out later with one of the other programming languages. An example of a structure of SFC program can be shown in the diagram below: 0 Fase Phase Transizione Transition a 1 Azione Action 11 b c 2 Azione Action 22 Azione Action 33 Sequenze Simultaneous simultanee sequences 3 Azione Action 44 5 Azione Action 66 d 4 Azione Action 55 e 6 Azione Action 77 f 7 Azione 8 Action 8 g Commission. 5

INSTRUCTION LIST (IL) The Instruction List (also known as STL) is a textual programming language at a low level. Because of its greater complexity, it s mainly used for programming small applications or to improve parts of a more complex application. It s an assembly language so it s based on a syntax like: operator operating The main operators vary depending on the manufacturer of the PLC. An example of operators is represented in the following table: OPERATORS SIEMENS OMRON Description Logic line start U or O LD Input contact N.O. Negative line start UN or ON LN NOT Input contact N.C. Allocation = OUT Enabling non-retentive coil Allocation of the kind Flip-Flop SR Allocation of the kind Flip-Flop SR S KEEP Conjunction U AND Conjunction denied UN AND NOT Disjunction O OR R Enabling retentive coil Disabling retentive coil Connection in series with a second contact N.O. Connection in series with a second contact N.C. Connection in parallel with a second contact N.O. Disjunction denied ON OR NOT Connection in parallel with a second contact N.C. Connection in series between groups Connection in parallel between groups U ( ) O AND LD OR LD Connection in series between two groups previously defined Connection in parallel between two groups previously defined Timer activation L KT T TIM Timer activation Counter increase ZV L KZ CNT End of the program BE END (FUN 01) It increases of a unit the value of the counter End of the program Commission. 6

As an example of STL programming, we will see the translation of the LAD programming previously seen for Omron PLCs: U I0.0 (Siemens) = Q0.0 U I0.0 (Siemens) U I0.1 = Q0.1 U I0.0 (Siemens) UN I0.1 = Q0.1 LD 010 (Omron) OR 002 OUT 200 LD 010 (Omron) OR NOT 002 OUT 100 LD 010 (Omron) OR NOT 004 (intermediate result A) LD NOT 002 OR 005 (intermediate result B) AND LD (A*B) OUT 100 LD 010 (Omron) AND NOT 002 (intermediate result A) LD NOT 004 AND 005 (intermediate result B) OR LD (A+B) OUT 100 Commission. 7

STRUCTURED TEXT (ST) The Structured Text is a textual programming language at a high level similar to the Pascal language or some Basic ones. The advantage of this method of programming occurs when you need to perform complex mathematical calculations or conditional tests with multiple alternatives. In these cases, the programming with ST language is reduced to a few lines of program. The Structured Text always involves declaring variables before and after the code of the operations carried out for checking the outputs. An example of code written in ST could be: IF Speed > 1000 THEN Tension := Tension - 10; END_IF Q0.1 := 1; This code is based on a variable speed and this condition is redefined according to the value of a second variable tension. In the final part of the code, it s assigned the value 1 to the output Q0.1. Commission. 8