Automazione Industriale 3 - I linguaggi di programmazione.



Similar documents
Programming languagesfor PLC: International Standard IEC (part one)

Programming languagesfor PLC: International Standard IEC (part two)

Understanding the IEC Programming Languages

Industrial Process Automation (Exercise)

Linear Motion and Assembly Technologies Pneumatics Service. Understanding the IEC Programming Languages

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

SoMachine. Getting & Setting Real Time Clock SysTime Library Guide 04/ EIO SoMachine

SCADAPack E ISaGRAF 3 User Manual

IEC The Fast Guide to Open Control Software

Ladder and Functional Block Programming

Programmable Logic Controller PLC

Candle Plant process automation based on ABB 800xA Distributed Control Systems

Technical Training Module ( 30 Days)

Programmable Logic Controllers Definition. Programmable Logic Controllers History

2 Building Blocks of IEC

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

Programming A PLC. Standard Instructions

Fig 3. PLC Relay Output

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

Automating with STEP7 in LAD and FBD

Automating witfi STEP7 in LAD and FBD

Industrial Communications Training

Designing an efficient Programmable Logic Controller using Programmable System On Chip

THE DESIGN OF A PORTABLE PROGRAMMABLE LOGIC CONTROLLER (PLC) TRAINING SYSTEM FOR USE OUTSIDE OF THE AUTOMATION LABORATORY.

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

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

CLEANING IN PLACE AUTOMATION FOR PROCESS INDUSTRY USING PLC AND SCADA SOFTWARE

PLCs and SCADA Systems

International standards on technical. documentation. documentation. International Electrotechnical Commission

Visual Programming of Logic, Motion, and Robotics

Programming Logic controllers

Control of Boiler Operation using PLC SCADA

PROGRAMMABLE LOGIC CONTROL

An Open Source IEC Integrated Development Environment

Automation software Concept V2.6 The flexible IEC development environment to optimize PLC performance

straton Universal control and strong connections. embedded field bus controller soft-plc scada logic

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

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

Series Six Plus Programmable Controller

Beremiz The Free and Open Source IEC Automation IDE

SIMATIC. Structured Control Language (SCL) for S7-300/S7-400 Programming. Preface, Contents. Part 1: Designing Programs

3BASIC RELAY INSTRUCTIONS

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

BECKHOFF. Application Notes. BC9000: Getting Started Guide. For additional documentation, please visit.

A Component-Based Design Pattern for Improving Reusability of Distributed Automation Programs

Training Document for Integrated Automation Solutions Totally Integrated Automation (TIA) MODULE M1

Degree programme in Automation Engineering

Logix5000 Controllers Function Block Diagram

PROG0101 Fundamentals of Programming PROG0101 FUNDAMENTALS OF PROGRAMMING. Chapter 3 Algorithms

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

How to read this guide

THE STEP7 PROGRAMMING LANGUAGE

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

LADDER LOGIC/ FLOWCHART PROGRAMMING DIFFERENCES AND EXAMPLES

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

Creating Relay Logic Diagrams

Mitsubishi Electric Q Series PLC Ladder Monitor. Operation Manual

COMPUTER-AIDED SYSTEM SOFTWARE

NEW GENERATION PROGRAMMABLE AUTOMATION CONTROLLER

SHORT TRAINING COURSES

Having read this workbook you should be able to: recognise the arrangement of NAND gates used to form an S-R flip-flop.

Remote monitoring of Crouzet Millenium 3 Using Netbiter EasyConnect EC220 & Netbiter Argos

AN APPLICATION STUDY FOR THE CLASS IE DIGITAL CONTROL AND

SECTION 2 PROGRAMMING & DEVELOPMENT

Training Document for Comprehensive Automation Solutions Totally Integrated Automation (T I A) MODULE C2. High Level Programming with S7-SCL

SOFTWARE-IMPLEMENTED SAFETY LOGIC Angela E. Summers, Ph.D., P.E., President, SIS-TECH Solutions, LP

SIMATIC. C7-621, C7-621 AS-i Control Systems. Volume 2 Working with C7 A B C D E. Contents. User Information. Introduction. Startup.

Lecture 8: Synchronous Digital Systems

Contents 1 Introduction Building Blocks of IEC

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

Module 1 Overview ControlLogix5000

Memory Elements. Combinational logic cannot remember

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

Industrial Training Schedule Spring 2012

Ramp-Up and Maintenance with Augmented Reality in Development of Flexible Production Control Systems

Open Automation Project Overview

for both the Verbatim Gateway and Catalyst Autodialer EtherNet Options

Programmable Logic Controllers

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

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

11. FLOWCHART BASED DESIGN

How To Use B&R Automation

Introduction To SCADA and Telemetry

First Steps with CoDeSys. Last update:

Complete Software Solution for Teaching Future Technicians and Engineers that Covers all Levels

Cut down your costs, increase your productions efficiently with the knowledge of PLC s Siemens technology. SITRAIN TM THAILAND Page 1 of 14

Products and solutions for pumping, irrigation and piping

Controller Automation, Model II+

AC 800M Library Object Style Guide

INTRODUCTION TO DIGITAL SYSTEMS. IMPLEMENTATION: MODULES (ICs) AND NETWORKS IMPLEMENTATION OF ALGORITHMS IN HARDWARE

IntesisBox KNX Modbus RTU master

Introduction to LogixPro - Lab

Four/Five Axis TB6560 CNC Driver Users Manual

CIS 117 DATABASE MANAGEMENT SOFTWARE APPLICATIONS

CHAPTER 11: Flip Flops

Introduction to Simulink & Stateflow. Coorous Mohtadi

Three Axis TB6560 CNC Driver Users Manual

Transcription:

Automation Robotics and System CONTROL Università degli Studi di Modena e Reggio Emilia Automazione Industriale 3 - I linguaggi di programmazione. (Prima Parte) Cesare Fantuzzi (cesare.fantuzzi@unimore.it) Ingegneria Meccatronica Ingegneria della Gestione Industriale AA 2010/2011

IEC Standards Commission(IEC) The International Electrotechnical ס is a not-for-profit, non-governmental international standards organization that prepares and publishes International Standards for all electrical, electronic and related technologies. The IEC held its inaugural meeting on 26 June ס 1906, following discussions between the British IEE, the American Institute of Electrical and Electronics Engineers (IEEE) (then called AIEE), and others. countries. It currently counts more than 130 ס Originally located in London, the commission moved to ס its current headquarters in Geneva in 1948. C. Fantuzzi 3. I Linguaggi di Programmazione 2

IEC 61131 Standard IEC 61131 is an IEC standard for Programmable logic controllers (PLCs). It was known as IEC 1131 before the change in numbering system by IEC. - 1 General overview, definitions - 2 Hardware - 3 Programming Languages - 4 User Guidelines - 5 Messaging Service Specification - 7 Fuzzy Logic - 8 Implementation guidelines C. Fantuzzi 3. I Linguaggi di Programmazione 3

Key quality features of IEC 61131-3 Structured software - through use of Configuration, Resource and Program Organization Units (POUs), that implements software modularization. Data Typing languages restrict operations to only apply to appropriate types of data Execution control - use of tasks Discrete event system handling - Sequential Function Charts Software encapsulation - through use of POUs, structures and complex data types. C. Fantuzzi 3. I Linguaggi di Programmazione 4

History of IEC 61131 NEMA Programmable Controllers Committee formed (USA) GRAFCET (France) DIN 40719, Function Charts (Germany) NEMA ICS-3-304, Programmable Controllers (USA) IEC SC65A/WG6 formed DIN 19 239, Programmable Controller (Germany) IEC 65A(Sec)38, Programmable Controllers MIL-STD-1815 Ada (USA) IEC SC65A(Sec)49, PC Languages IEC SC65A(Sec)67 IEC 848, Function Charts IEC 64A(Sec)90 IEC 1131-3 Type 3 report recommendation 70 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 Source: Dr. J. Christensen it took 20 years to make that standard C. Fantuzzi 5 3. I Linguaggi di Programmazione 96 IEC 61131-3 name change

Importance of the IEC61131 IEC 61131-3 is the most important automation language ס in industry. 80% of all PLCs support it, all new developments base ס on it. Depending on the PLC vendor (and often ס Country because cultural reasons), some languages are most used. C. Fantuzzi 3. I Linguaggi di Programmazione 6

Application Configuration configuration (Hardware) resource resource

Application configuration (Software) configuration resource resource program program program program FB FB FB FB

Application Software (Run Time) configuration resource resource task task task task program program program program FB FB FB FB A Task is a run time (scan) instance of a program.

IEC 61131 Software Model (Variable exchange) configuration resource resource task task task task program program program program FB FB FB FB global and directly represented variables access paths communication function legend: or execution control path variable access paths FB function block variable C. Fantuzzi 3. I Linguaggi di Programmazione 10

Communication model (a) C. Fantuzzi 3. I Linguaggi di Programmazione 11

Communication model (b) C. Fantuzzi 3. I Linguaggi di Programmazione 12

Data types ס Variables ס IEC Programming Model (POU) Program organization units ס Functions Function blocks Programs } Programming languages (Programming Sequential Function Chart (SFC) elements ס Configuration elements ס Global variables Resources Access paths Tasks C. Fantuzzi 3. I Linguaggi di Programmazione 13 } language)

graphical languages Function Block Diagram (FBD) The five IEC 61131-3 Programming languages AUTO DI CALC1 CALC V IN1OUT >=1 MAN_ON ACT IN2 Ladder Diagram (LD) CALC1 Sequential Flow Chart (SFC) PUMP DO V START STEP T1 STEP A N ACTION D1 D1_READY T2 D ACTION D2 D2_READY STEP B N ACTION D3 D3_READY D ACTION D4 D4_READY T3 AUTO ACT MAN_ON CALC IN1 OUT IN2 PUMP textual languages Structured Text (ST) VAR CONSTANT X : REAL := 53.8 ; Z : REAL; END_VAR VAR afb, bfb : FB_type; END_VAR Instruction List (IL) A: LD %IX1 (* PUSH BUTTON *) ANDN %MX5 (* NOT INHIBITED *) ST %QX2 (* FAN ON *) bfb(a:=1, B:= OK ); Z := X - INT_TO_REAL (bfb.out1); IF Z>57.0 THEN afb(a:=0, B:= ERR ); ELSE afb(a:=1, B:= Z is OK ); END_IF

Structured Text (ST) ST is a textual language similar to C, or (for who might ס remember it) PASCAL. ST can be successfully used to develop complex ס algorithm, data structure handling, etc. ST has the syntactical structure of the procedural ס programming languages: Assignment Choices Iteration C. Fantuzzi 3. I Linguaggi di Programmazione 15

Assignment The variable on the left side should be of the same type ס of the result of the expression of the right side. on contrary, the ST compiler will introduce a variable ס casting to set all the variables to the same type. <variable> := <expression>; C. Fantuzzi 3. I Linguaggi di Programmazione 16

Choices IF <Boolean_Expr_1> THEN <code>; ELSIF <Boolean_Expr_2> THEN <code>; ELSE <code>; END_IF CASE <integer_expression> OF <integer_value_1> : <code>; <integer_value_2> : <code>;... ELSE <code>; END_CASE C. Fantuzzi 3. I Linguaggi di Programmazione 17

Iteration REPEAT <code>; UNTIL <Boolean_Expr> END_REPEAT; WHILE <Boolean_Expr> DO <code> END_WHILE; FOR <integer_variable>:= <initial_value> TO <final_value> BY <step> DO <code> END_FOR; C. Fantuzzi 3. I Linguaggi di Programmazione 18

Warning The iteration structure may violate the real time concerns ס of the program. An iteration can t be done to wait for a external variable ס changes. C. Fantuzzi 3. I Linguaggi di Programmazione 19

ST Operators (a) C. Fantuzzi 3. I Linguaggi di Programmazione 20

ST Operators (b) C. Fantuzzi 3. I Linguaggi di Programmazione 21

Functional Block Language Funktionsblocksprache, Langage de blocs de ס fonction. Also called "Function Chart" or "Function Plan" FuPla ס "combinatorial The function block languages express ס programs in a way similar to electronic circuits. They draw on a large variety of predefined and custom ס functions C. Fantuzzi 3. I Linguaggi di Programmazione 22

Function Block Examples Example 1: A B & C Example 2: external inputs external outputs Trigger T & Running Reset S R Spin Function blocks is a graphical programming language, which is akin to the electrical and block diagrams of the analog and digital technique. It mostly expresses combinatorial logic, but its blocks may have a memory (e.g. flip-flops). C. Fantuzzi 3. I Linguaggi di Programmazione 23

Function Block Elements Function block parameters Example set point measurement PID motor "continuously" executing block, independent, no side effects The block is defined by its: Data flow interface (number and type of input/output signals) Black-Box-Behavior (functional semantic, e.g. in textual form). Signals Connections that carry a pseudo-continuous data flow. Connects the function blocks. Example set point (set point) (set point) C. Fantuzzi 3. I Linguaggi di Programmazione 24

Function Block Example C. Fantuzzi 3. I Linguaggi di Programmazione 25

Rule of evaluation Each signal is connected to exactly one source ס This source can be the output of a function block or a plant signal. The type of the output pin, the type of the input pin and the ס signal type. bottom. The signals flow from left to right and from top to ס Feedback is an exception: the signal direction is from right ס to the left, and it is identified by an arrow a b x z c y C. Fantuzzi 26

Ladder Diagram contacts) (Kontaktplansprache, langage à ס The ladder logic is the oldest programming language for ס PLC electricians. it bases directly on the relay intuition of the ס it is widely in use outside ס Europe. It is described here but not recommended for new ס projects. C. Fantuzzi 3. I Linguaggi di Programmazione 27

Ladder Logic (1) origin: electrical circuit 01 make contact 02 relay coil (bobine) 03 50 break contact (contact repos) 01 02 corresponding ladder diagram 03 50 rung 50 05 C. Fantuzzi 3. I Linguaggi di Programmazione 28 44 "coil" 50 is used to move other contact(s)

Ladder logic (2) The contact plan or "ladder logic" language allows an easy transition from the traditional relay logic diagrams to the programming of binary functions. It is well suited to express combinational logic It is not suited for process control programming (there are no analog elements). The main ladder logic symbols represent the elements: make contact break contact relay coil contact travail contact repos bobine Arbeitskontakt Ruhekontakt Spule C. Fantuzzi 3. I Linguaggi di Programmazione 29

Ladder logic (3) Binary combinations are expressed by series and parallel relay contact: ladder logic representation "CMOS" equivalent Series + 01 02 01 50 02 50 Coil 50 is active (current flows) when 01 is active and 02 is not. Parallel + 01 02 40 01 02 40 Coil 40 is active (current flows) when 01 is active or 02 is not. C. Fantuzzi 3. I Linguaggi di 30 Programmazione

Ladder logic (4) The ladder logic is more intuitive for complex binary expressions than literal languages textual expressions 1 2 3 4 5 6 %50!N 1 & 2 STR 3 & N 4 STR N 5 & 6 / STR & STR = %50 0 1 4 5 2 3 6 7 12 %50!0 & 1 STR 2 & 3 / STR STR 4 & 5 STR N 6 & 7 10 11 / STR & STR STR 10 & 11 / STR & 12 = %50 C. Fantuzzi 3. I Linguaggi di Programmazione 31

Ladder logic (5) Ladder logic stems from the time of the relay technology. As PLCs replaced relays, their new possibilities could not be expressed any more in relay terms. The contact plan language was extended to express functions: 00 01 FUN 02 200 literal expression:!00 & 01 FUN 02 = 200 The intuition of contacts and coil gets lost. The introduction of «functions» that influence the control flow itself, is problematic. The contact plan is - mathematically - a functional representation. The introduction of a more or less hidden control of the flow destroys the freedom of side effects and makes programs difficult to read. C. Fantuzzi 3. I Linguaggi di Programmazione 32