PLCopen
for efficiency in automation
Technical Paper
PLCopen Technical Committee 6
XML Formats for IEC 61131-3
Version 1.01 –Official Release
DISCLAIMER OF WARANTIES
THIS DOCUMENT IS PROVIDED ON AN “AS IS” BASIS AND MAY BE SUBJECT TO
FUTURE ADDITIONS, MODIFICATIONS, OR CORRECTIONS. PLCOPEN HEREBY
DISCLAIMS ALL WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE,
FOR THIS DOCUMENT. IN NO EVENT WILL PLCOPEN BE RESPONSIBLE FOR ANY
LOSS OR DAMAGE ARISING OUT OR RESULTING FROM ANY DEFECT, ERROR OR
OMISSION IN THIS DOCUMENT OR FROM ANYONE’S USE OF OR RELIANCE ON THIS
DOCUMENT.
Copyright © 2003 - 2005 by PLCopen. All rights reserved.
Date: 10/06/05
Total number of pages: 58
PLCopen
for efficiency in automation
TC6 XML © PLCopen (2004, 2005)
Version 1.01 – Official release 10/06/2005 page 2/58
The following paper
XML Formats for IEC 61131-3
is a document representing the results of the work done in the PLCopen Technical Committee 6 -
XML. This release 1.0 is based on the work done on the version 0.99, ‘Release for Comments’, as
published in April 2004, as well as the feedback received.
This specification has been written thanks to the following members of the TC6 XML:
Dieter Hess 3S
Dirk Schubel 3S
Alexander Fay ABB
Johan Gren ABB
Josef Papenfort Beckhoff
Uwe Thomas Beckhoff
Matthias Riedl ifak
Thomas Brandl Indramat
Michael Sperber infoteam Software
Christina Böttger infoteam Software
Wolfgang Horn IST
Dietmar Berlesreiter Keba
Thomas Baier Kirchner Soft
Andreas Weichelt KW Software
Dimitrij Kirzhner KW Software
Hansjörg Hotz Matsushita
Monique Atali-Ringot Rockwell Automation
Paul Brooks Rockwell Automation
Heinz Dieter Ferling Schneider Automation
Hans Peter Otto Siemens
Achim Koch SMS Demag
Gerd Schneider Softing
Les Powers Triconex
Eelco van der Wal PLCopen
Change Status List:
Version
number
Date Change comment
V 0.0 06/05/2002 Preliminary draft with additions from PLCopen
V0.1 14/01/2003 Results of the meeting at infoteam software
V 0.2 25/02/2003 Results of the meeting at Beckhoff Elektronik
V 0.3 06/05/2003 Results of the meeting at Matsushita Electric Works
V 0.4 17/06/2003 Results of the meeting at Kirchner SOFT
V 0.5 15/07/2003 Results of the meeting in Amsterdam
V 0.6 2/10/2003 Results of the meeting at KW Software, Lemgo, Germany
V 0.7 28/11/2003 Results of the meeting in Neurenberg, with further editing by EvdW
V 0.71 31/03/2003 Hotz: All elements that describe IEC 61131-3 object are entered
V 0.8 09/04/2004 Final version before release as 0.99 – EvdW
V 0.99 16/04/2004 Released as Version 0.99 – in combination with scheme
V 0.99 A 14/02/2005 Based on the feedback on the Version 0.99. Meeting Feb. 8+9, 05
V 0.99 B 18/04/2005 Changed pictures included. US proof reading.
PLCopen
for efficiency in automation
TC6 XML © PLCopen (2004, 2005)
Version 1.01 – Official release 10/06/2005 page 3/58
V 1.0 27/04/2005 Last minor changes done. Examples added cf. new xsd. Official
release
V 1.01 10/06/2005 Minor update: “refLocalId” is required. Text and examples updated.
PLCopen
for efficiency in automation
TC6 XML © PLCopen (2004, 2005)
Version 1.01 – Official release 10/06/2005 page 4/58
Table of Contents
1 INTRODUCTION....................................................................................................................6
1.1. PURPOSE..................................................................................................................................6
1.2. SHORT INTRODUCTION INTO XML...........................................................................................7
2 SCOPE..........................................................................................................................................9
2.1. USE CASE – EXCHANGE FORMAT FOR PROGRAMMING TOOLS (ALL IEC LANGUAGES).............9
2.2. USE CASE: INTERFACE TO PRODUCERS OF GRAPHICAL AND LOGICAL INFORMATION ...............9
2.3. USE CASE: INTERFACE TO CONSUMER OF GRAPHICAL AND LOGICAL INFORMATION. ...............9
2.4. USE CASE – DISTRIBUTION FORMAT FOR FUNCTION BLOCK LIBRARIES ...................................9
2.5. GRAPHICAL OVERVIEW OF THE USE CASES............................................................................10
3 DEFINITIONS, COMPLIANCE, VALIDATION AND TRANSFORMATIONS.............11
3.1. DEFINITIONS..........................................................................................................................11
3.2. NAMING CONVENTIONS.........................................................................................................11
3.3. COMPLIANCE TO IEC 61131-3 – 2
ND
EDITION ........................................................................11
3.4. COMPLIANCE TO SUPPLIER SPECIFIC EXTENSIONS ..................................................................11
3.5. VALIDATION, TRANSFORMATION AND REPRESENTATION OF XML DOCUMENTS ...................12
3.6. FORMATTED TEXT..................................................................................................................14
3.7. DEFINITION OF THE COORDINATE SYSTEM FOR GRAPHICAL INFORMATION: ...........................14
3.8. POSITIONS..............................................................................................................................15
3.9. DEFINITION OF THE EXECUTION ORDER OF THE GRAPHICAL ELEMENTS .................................17
3.10. REFERENCE OF GRAPHICAL ELEMENTS...................................................................................17
4 OVERVIEW OF THE SCHEME EXPLANATION .............................................................18
5 PROJECT STRUCTURE.........................................................................................................19
5.1. HEADER INFORMATION OF AN XML FILE...............................................................................19
5.2. HEADER ELEMENTS ...............................................................................................................19
fileHeader.................................................................................................................................................................................... 19
contentHeader.............................................................................................................................................................................. 20
coordinateInfo.............................................................................................................................................................................. 20
6 TYPE SPECIFIC PART...........................................................................................................21
6.1. DEFINED DATATYPES ............................................................................................................21
6.2. POU
S.....................................................................................................................................22
actions.......................................................................................................................................................................................... 22
transitions .................................................................................................................................................................................... 22
body............................................................................................................................................................................................. 22
6.3. POUS – DECLARATION SECTION ............................................................................................23
6.4. POUS – CODE SECTION ..........................................................................................................24
6.4.1. General..............................................................................................................................24
position........................................................................................................................................................................................ 24
relPosition.................................................................................................................................................................................... 24
content ......................................................................................................................................................................................... 24
variable........................................................................................................................................................................................ 25
expression.................................................................................................................................................................................... 25
values........................................................................................................................................................................................... 25
documentation ............................................................................................................................................................................. 25
6.5. C
OMMONALITIES OF GRAPHICAL LANGUAGES .......................................................................26
Overview Common Objects......................................................................................................................................................... 26
comment...................................................................................................................................................................................... 26
error ............................................................................................................................................................................................. 26
connector ..................................................................................................................................................................................... 27
connectionPointIn........................................................................................................................................................................ 27
connection.................................................................................................................................................................................... 28
PLCopen
for efficiency in automation
TC6 XML © PLCopen (2004, 2005)
Version 1.01 – Official release 10/06/2005 page 5/58
continuation................................................................................................................................................................................. 28
connectionPointOut ..................................................................................................................................................................... 29
actionBlock.................................................................................................................................................................................. 29
Additional information ................................................................................................................................................................ 30
6.5.1. SFC elements.....................................................................................................................31
step............................................................................................................................................................................................... 31
connectionPointOutAction........................................................................................................................................................... 32
macroStep.................................................................................................................................................................................... 32
jumpStep...................................................................................................................................................................................... 32
transition...................................................................................................................................................................................... 33
selectionDivergence..................................................................................................................................................................... 33
selectionConvergence.................................................................................................................................................................. 34
simultaneousDivergence.............................................................................................................................................................. 34
simultaneousConvergence........................................................................................................................................................... 35
6.5.2. FBD elements ....................................................................................................................36
block............................................................................................................................................................................................ 36
inVariable.................................................................................................................................................................................... 36
outVariable .................................................................................................................................................................................. 37
inoutVariable............................................................................................................................................................................... 37
label ............................................................................................................................................................................................. 38
jump............................................................................................................................................................................................. 38
return ........................................................................................................................................................................................... 39
6.5.3. LD elements.......................................................................................................................40
leftPowerRail............................................................................................................................................................................... 40
rightPowerRail............................................................................................................................................................................. 40
coil............................................................................................................................................................................................... 41
contact ......................................................................................................................................................................................... 41
6.6. SCHEMA TEXTUAL LANGUAGES:...........................................................................................42
6.6.1. Structured Text (ST) and Instruction List (IL) ..................................................................42
7 INSTANCE SPECIFIC PART.................................................................................................43
7.1. CONFIGURATION ....................................................................................................................43
7.2. RESOURCE..............................................................................................................................43
7.3. TASK......................................................................................................................................43
7.4. POU INSTANCES ....................................................................................................................44
8 CERTIFICATION ....................................................................................................................45
9 EXAMPLES...............................................................................................................................46
9.1. SIMPLE EXAMPLE FOR FBD ...................................................................................................46
Graphical Representation............................................................................................................................................................. 46
XML example code ..................................................................................................................................................................... 46
9.2. S
IMPLE EXAMPLE FOR SFC....................................................................................................50
Graphical Representation............................................................................................................................................................. 50
XML............................................................................................................................................................................................ 50
9.3. E
XAMPLE CONNECTORS, CONNECTION AND VARIABLES ........................................................55
Graphical representation.............................................................................................................................................................. 55
XML output example................................................................................................................................................................... 55
9.4. EXAMPLE ON FORKED CONNECTIONS.....................................................................................57
XML output example................................................................................................................................................................... 57