IEC IEC 61131-3 61131-3 Basics Basics and and PLCopen PLCopen European Panasonic Headquarter, Germany created by created by Ralf Wohlschlaeger Ralf Wohlschlaeger General Manager Factory Automation General Manager Factory Automation Panasonic Electric Works (Europe) AG Panasonic Electric Works (Europe) AG Chairman of PLCopen PC1 committee (promotion) Chairman of PLCopen PC1 committee (promotion) Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 Contents Contents:: --What WhatisisIEC IEC61131-3 61131-3?? --History History --Advantages Advantages --Explanation Explanation --What WhatisisPLCopen PLCopen?? --Organisation Organisation --Current Currenttopics topics Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 The Way to IEC61131-3 Programming 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 IEC 61131-3 name change 70 77 78 79 80 81 82 83 84 85 86 Source: Dr. J. Christensen (-1995) / R. Wohlschlaeger (-2003) Panasonic Electric Works Europe AG 87 88 89 90 91 92 93 94 95 96 2003 IEC 61131-3 second edition Wohlschlaeger / January 2006 Style of Software Conventional Conventional styled styled software software IEC IEC61131-3 61131-3styled styled software software Direct Directhardware hardwareaddress address:: -- X0, X0,X1...Y0,Y1....DT0,DT1..... X1...Y0,Y1....DT0,DT1..... 11Program Programfrom fromstart startto toend end IEC IECaddress: address: -- %IX0.....%QX0.....%MW5.0 %IX0.....%QX0.....%MW5.0 -- each eachVariable Variablehave haveaaname name -- each eachVariable Variablehave haveaadata datatype type -- global globaland andlocal localVariables Variables POU POUconcept: concept: -- 11program programor ormore moreprograms programs -- Function FunctionBlocks Blocksand andFunctions Functions Panasonic PanasonicControl ControlFPWIN FPWINPro Procan canuse useboth bothstyles styles Both Bothstyles stylescan canbe bemixed mixed Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 Why IEC 61131-3? IEC 61131-3 An internationally accepted standard ••Unified Unifiedrules rulesin insystems systemsworldwide, worldwide, reduces reducesmisunderstandings misunderstandingsand andshortens shortenstraining training ••Reuse Reuseof ofready-made ready-madeFunctions Functionsand andFunction FunctionBlocks, Blocks, saves savestime timefor forprogramming programmingand anddebugging debugging ••Better Betteroverview overviewthrough throughstructure structureand andmodularity modularity ••Fewer Fewererrors errorsthrough throughdefined defineddata datatypes typesand andencapsulation encapsulation ••Safe Safeinvestment investmentdue dueto to standardisation standardisation Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 Examples of IEC 61131-3 advantages Variables : l better documentation --> programming by names / symbols l I/O connection list already stored in the project l Base for the re-use of software POUs : SFC : General : Panasonic Electric Works Europe AG l structured programming l well defined interface --> other variables can be used in other projects l re-use of Function Blocks saves time and debugging l flowchart on the monitor l divide big programs into small and easy parts l top down development / bottom up --> well structured l different languages in the program l easy debugging and error locating - only the current step is active l save training time for programmers l enables parallel software development by more programmers l certification ensures users to protect their investments for the future Wohlschlaeger / January 2006 Use Variable Names instead of Addresses Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 IEC 61131-3 Functions Conventional programming requires different functions for e.g.: 16-bit EN s1 s2 32-bit EN s1 s2 4-digit BCD data 8-digit BCD data Floating point data Panasonic Electric Works Europe AG EN s1 s2 EN s1 s2 EN s1 s2 Flexible IEC instructions: 1 function instead of several F22_ADD2 ENO d F23_ADD2 ENO d ADD F42_ADD2 ENO d F43_ADD2 ENO d EN a_NumN a_NumN ENO Input data must be of the same data type! F310_FADD ENO d Wohlschlaeger / January 2006 The IEC 61131 Standard - The PLC Standard l Part 1 l Part 2 General overview, definitions Hardware l I/O signals, safety requirements, environment l Part 3 l Part 4 l Part 5 Programming Languages User Guidelines Communication l Part 6 l Part 7 l Part 8 Reserved Fuzzy control Technical Report International Standard Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 IEC 61131-3 Software Model Configuration A Resource L Task1 Program P1 Resource L Task2 Task3 Program P2 Program P3 FB1 FB3 FB2 Task4 Program P4 FB4 global and direct adressed variables access paths Task association Access path association Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 Common Elements of the IEC 61131-3 IEC IEC61131-3: 61131-3: The The55Programming ProgrammingLanguages Languages and and The TheCommon CommonElements Elements • Character set (English.........) • Data types (BOOL, WORD, INTEGER.................) • Variables (VAR, VAR_input, VAR_output..........) • POUs, Program Organisation Units (Function, Function Block...) • SFC Elements (Steps, Transitions.................................) • Configuration elements: (Tasks) ••Basis Basisfor forsoftware softwarere-use re-use Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 IEC 61131-3 Elementary Data Types No. Keyword 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 Panasonic Electric Works Europe AG Data Type Bits BOOL SINT INT DINT LINT USINT Boolean Short integer Integer Double integer Long integer Unsigned short integer 1 8 16 32 64 8 UINT UDINT ULINT REAL LREAL TIME DATE TIME_OF_DAY or TOD DATE_AND_TIME or DT STRING BYTE WORD DWORD LWORD Unsigned integer Unsigned double integer Unsigned long integer Real numbers Long reals Duration Date (only) Time of day (only) 16 32 64 32 64 Date and time of day Character string Bit string of length 8 Bit string of length 16 Bit string of length 32 Bit string of length 64 8 16 32 64 Wohlschlaeger / January 2006 The 5 Languages of IEC 61131-3 Instruction List LD A ANDN B ST C Structured Text C:= A AND NOT B Step 1 N FILL Transition 1 Function Block Diagram Ladder Diagram A B AND A Sequential Function Chart C B Panasonic Electric Works Europe AG Step 2 C S Empty Transition 2 -| |--|/|----------------( ) Step 3 Wohlschlaeger / January 2006 POU = Program Organization Unit • A POU consists of a header (variable declaration) and the body (instructions) • POUs enable the re-use of software from macro level (Programs) to micro level (FB and Functions) POU Type Program Function Block Replicated as: Program instance FB instance Function Function Panasonic Electric Works Europe AG Comments Main program Subroutine with own memory, several in and outputs possible Subroutine without own memory Wohlschlaeger / January 2006 Function Blocks can be easily reused 1. Function Block so FU_Block a ftw re OUT_1 IN_1 IN_2 2. Variable Interface IN_3 FU-Block Header 0 1 2 3 Class Identifier VAR_INPUT VAR_INPUT VAR_INPUT VAR_OUPUT IN_1 IN_2 IN_3 OUT_1 Panasonic Electric Works Europe AG Type BOOL BOOL BOOL BOOL 3. Program body Program Program once once reuse reuse always always LD AND OR AND : : : : ST IN_1 IN_2 OUT_1 IN_3 : : : : OUT_1 Wohlschlaeger / January 2006 Easy Programming of FBs and FUN Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 Easy Programming of FBs and FUN Define Defineinputs inputsand andoutputs outputs Panasonic Electric Works Europe AG Program ProgramFB FBcontents contents Wohlschlaeger / January 2006 Library Concept Libraries: Special_Lib IEC_Standard_Lib Vendor_Lib Pulsed_Lib Communication_Lib PID_Lib Special_Project_Lib TWO_TRIP POSITION_2_AX POSITION_3_AX WAIT_10s ELEVAT_4_FL : : : • Self-created FBs can be stored in libraries • Comfortable structuring and sorting in the libraries • Know-how protection of FBs and libraries • Easy reuse of tested software --> saves time Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 PLCopen is a World-wide association Main Office in Europe Office in North America Panasonic Electric Works Europe AG Office in Japan Wohlschlaeger / January 2006 PLCopen PLCopen PLCopenwas wasfounded foundedon onJune June15, 15,1992 1992in inGiessen, Giessen,Germany. Germany. Target Targetwas wasto topromote promoteIEC IEC61131-3, 61131-3,inform informcustomers customersand andgive give more moreweight weightto tothe theIEC IEC61131-3 61131-3standard. standard. PLCopen Standardization in Industrial Control programming TC6 Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 PLCopen Mission We We want want to to be be the the leading leading association association resolving resolving topics topics related related to to control control programming programming to to support support the the use use of of international international standards standards in in this this field. field. Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 PLCopen is a World-wide association > 80 members (June 2004) from 19 countries all over the world Suppliers, institutes and users See newsletter / website for up-to-date list Details Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 The Essence of Compliancy --The TheIEC IEC61131 61131standard standardgives givesrules rulesfor forcompliancy compliancy --Certification Certificationguides guidesusers userstowards towardsreal realIEC IEC61131-3 61131-3 programming programmingsystems systems(e.g. (e.g.PLCopen PLCopencertified certifiedproducts) products) Without Withouttesting testing there thereisisno nostandard standard Meanwhile Meanwhileonly onlytruly trulycompliant compliantIEC IEC61131-3 61131-3systems systems are arepromoted promotedas asIEC IEC61131-3 61131-3products products Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 TC3: PLCopen Compliance Levels Application Program FB Variable Code Body FB FB Variable Variable Code Code Body Body Panasonic Electric Works Europe AG Conformity Level & Reusability Level Re-usability of Function (Block) libraries Base Level Portability of minimal systems Application Program FB FB FB Variable Code Body Variable Variable Code Code Body Body Wohlschlaeger / January 2006 Certification Certified products can use these logos Base BaseLevel: Level: first firststep stepinto intoIEC IEC61131-3 61131-3software software Conformity ConformityLevel: Level: conforms conformsto toIEC IEC61131-3 61131-3based basedon on supported supporteddata datatypes types Reusability ReusabilityLevel: Level: reuse reuseof ofIEC IEC61131-3 61131-3Function FunctionBlocks Blocks based basedon onsupported supporteddata datatypes types Motion MotionControl: Control: certified certifiedFunction FunctionBlocks Blocksaccording accordingthe the Motion MotionControl Controlspecification specification XML: XML: Opening Openingup upthe thedevelopment development environments environmentsby byspecifying specifyingXML XML formats formatsfor forIEC IEC61131-3 61131-3 Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 Reusability Level ST BOOL INT WORD BOOL INT WORD FU_Body FU_Body OUT_1 IN_1 IN_2 IN_2 OK IN_3 BOOL LINT WORD OUT_1 IN_1 IN_3 BOOL WORD FU_Body OUT_1 IN_1 IN_2 IN_3 no LINT FU_Body X Not possible OUT_1 IN_1 IN_2 IN_3 Function FunctionBlock Blockexchange exchangein inST STlanguage languageisispossible: possible: ••ififboth bothsystems systemshave havethe theReusability ReusabilityLevel LevelST ST ••the theused usedinstructions instructionsare areIEC IEC61131-3 61131-3instructions instructions ••the thesame samedata datatypes typesare areavailable available Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 Why Motion Control FBs ? Revolutionizing the industry with a global standard Mechanics do not help anymore, a standard with software is possible Reduce maintainance and sanitation Less hardware parts, more software The Thesolution solutionis…..... is…..... ........Software ........Software Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 Motion Control Standardization means: ü Hardware independent Software Development ü Consistent Development Environment ü Consistent Installation and Maintenance Interface Same ‘Look and Feel’ IEC 61131-3 is a good base Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 The PLCopen Task Force Motion Control ü Initiated by Users ü ..to fulfil their requirements Goal : To harmonize the access for Motion Control across different platforms during development, installation and maintenance based on the IEC 61131-3 environment Panasonic Electric Works Europe AG Users: Bosch Packaging Kuka Kloeckner Tevopharm Focke EKB Hershey Foods Tetra Pak Suppliers: Siemens Elau Beckhoff Industrial Electronics SEW Eurodrive Mitsubishi Electric Europe Cross Hueller Lenze Parker Hannifin ISG Stuttgart Control Techniques Phoenix Contact Keba KW Software Rockwell Automation Nyquist Baumueller infoteam Software Rexroth Indramat Wohlschlaeger / January 2006 HW Independence via Function Blocks Software View Hardware View Encapsulation / Information Hiding Inputs Name Sercos Drive I/F Motor Outputs E PWM I/F Drive Motor E Panasonic Electric Works Europe AG Wohlschlaeger / January 2006 Example of a Function Block MoveAbsolute AXIS_REF BOOL REAL REAL REAL REAL REAL MC_Direction Panasonic Electric Works Europe AG Axis Execute Position Velocity Acceleration Deceleration Jerk Direction Axis Done CommandAborted Error ErrorID AXIS_REF BOOL BOOL BOOL WORD Wohlschlaeger / January 2006 Thank you ! Panasonic Electric Works Europe AG Wohlschlaeger / January 2006