Kuka KUKA.EthernetKRL 2.2 User manual

KUKA System Technology
KUKA.EthernetKRL 2.2
For KUKA System Software 8.2 and 8.3
KUKA Roboter GmbH
Issued: 19.12.2012
Version: KST EthernetKRL 2.2 V1 en (PDF)

KUKA.EthernetKRL 2.2
2 / 79 Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
© Copyright 2012
KUKA Roboter GmbH
Zugspitzstraße 140
D-86165 Augsburg
Germany
This documentation or excerpts therefrom may not be reproduced or disclosed to third parties without
the express permission of KUKA Roboter GmbH.
Other functions not described in this documentation may be operable in the controller. The user has
no claims to these functions, however, in the case of a replacement or service work.
We have checked the content of this documentation for conformity with the hardware and software
described. Nevertheless, discrepancies cannot be precluded, for which reason we are not able to
guarantee total conformity. The information in this documentation is checked on a regular basis, how-
ever, and necessary corrections will be incorporated in the subsequent edition.
Subject to technical alterations without an effect on the function.
Translation of the original documentation
KIM-PS5-DOC
Publication: Pub KST EthernetKRL 2.2 (PDF) en
Bookstructure: KST EthernetKRL 2.2 V1.1
Version: KST EthernetKRL 2.2 V1 en (PDF)

3 / 79Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
Contents
1 Introduction .................................................................................................. 5
1.1 Target group .............................................................................................................. 5
1.2 Industrial robot documentation ................................................................................... 5
1.3 Representation of warnings and notes ...................................................................... 5
1.4 Terms used ................................................................................................................ 6
1.5 Trademarks ................................................................................................................ 7
2 Product description ..................................................................................... 9
2.1 Overview of EthernetKRL .......................................................................................... 9
2.2 Configuration of an Ethernet connection .................................................................... 9
2.2.1 Behavior in the event of a lost connection ............................................................ 9
2.2.2 Monitoring a connection ........................................................................................ 10
2.3 Data exchange ........................................................................................................... 10
2.4 Saving data ................................................................................................................ 10
2.5 Client-server mode ..................................................................................................... 12
2.6 Protocol types ............................................................................................................ 12
2.7 Event messages ........................................................................................................ 13
2.8 Error treatment ........................................................................................................... 13
3 Safety ............................................................................................................ 15
4 Installation ................................................................................................... 17
4.1 System requirements ................................................................................................. 17
4.2 Installing or updating EthernetKRL ............................................................................ 17
4.3 Uninstalling EthernetKRL ........................................................................................... 18
5 Configuration ............................................................................................... 19
5.1 Network connection via the KLI of the robot controller .............................................. 19
6 Programming ............................................................................................... 21
6.1 Configuring an Ethernet connection ........................................................................... 21
6.1.1 XML structure for connection properties ............................................................... 21
6.1.2 XML structure for data reception .......................................................................... 24
6.1.3 XML structure for data transmission ..................................................................... 26
6.1.4 Configuration according to the XPath schema ..................................................... 27
6.2 Functions for data exchange ...................................................................................... 27
6.2.1 Programming tips .................................................................................................. 28
6.2.2 Initializing and clearing a connection .................................................................... 29
6.2.3 Opening and closing a connection ........................................................................ 30
6.2.4 Sending data ......................................................................................................... 31
6.2.5 Reading out data .................................................................................................. 33
6.2.6 Deleting received data .......................................................................................... 35
6.2.7 EKI_STATUS – Structure for function-specific return values ............................... 35
6.2.8 Configuration of event messages ......................................................................... 36
6.2.9 Reception of complete XML data records ............................................................. 37
6.2.10 Processing incomplete data records ..................................................................... 38
6.2.11 EKI_CHECK() – Checking functions for errors ..................................................... 38
7 Examples ...................................................................................................... 41
Contents

4 / 79 Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
KUKA.EthernetKRL 2.2
7.1 Application examples ................................................................................................. 41
7.1.1 Implementing application examples ..................................................................... 41
7.1.2 Server program user interface .............................................................................. 42
7.1.3 Setting communication parameters in the server program ................................... 43
7.2 Configuration and program examples ....................................................................... 44
7.2.1 BinaryFixed configuration example ...................................................................... 44
7.2.2 BinaryStream configuration example .................................................................... 45
7.2.3 XmlTransmit configuration example ..................................................................... 46
7.2.4 XmlServer configuration example ......................................................................... 48
7.2.5 XmlCallback configuration example ..................................................................... 48
8 Diagnosis ...................................................................................................... 53
8.1 Displaying diagnostic data ......................................................................................... 53
8.2 Error protocol (EKI logbook) ...................................................................................... 53
8.3 Error messages ......................................................................................................... 53
9 Appendix ...................................................................................................... 59
9.1 Extended XML structure for connection properties ................................................... 59
9.2 Increasing the memory .............................................................................................. 59
9.3 Deactivating message output and message logging ................................................. 60
9.4 Command reference .................................................................................................. 60
9.4.1 Initializing, opening, closing and clearing a connection ........................................ 60
9.4.2 Sending data ........................................................................................................ 61
9.4.3 Writing data .......................................................................................................... 62
9.4.4 Reading data ........................................................................................................ 63
9.4.5 Checking a function for errors .............................................................................. 67
9.4.6 Clearing, locking, unlocking and checking a memory ........................................... 67
10 KUKA Service ............................................................................................... 69
10.1 Requesting support ................................................................................................... 69
10.2 KUKA Customer Support ........................................................................................... 69
Index ............................................................................................................. 77

5 / 79Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
1 Introduction
1Introduction
1.1 Target group
This documentation is aimed at users with the following knowledge and skills:
Advanced KRL programming skills
Advanced knowledge of the robot controller system
Advanced knowledge of XML
Advanced knowledge of networks
1.2 Industrial robot documentation
The industrial robot documentation consists of the following parts:
Documentation for the manipulator
Documentation for the robot controller
Operating and programming instructions for the KUKA System Software
Documentation relating to options and accessories
Parts catalog on storage medium
Each of these sets of instructions is a separate document.
1.3 Representation of warnings and notes
Safety These warnings are relevant to safety and must be observed.
This warning draws attention to procedures which serve to prevent or remedy
emergencies or malfunctions:
For optimal use of our products, we recommend that our customers
take part in a course of training at KUKA College. Information about
the training program can be found at www.kuka.com or can be ob-
tained directly from our subsidiaries.
These warnings mean that it is certain or highly probable
that death or severe injuries will occur, if no precautions
are taken.
These warnings mean that death or severe injuries may
occur, if no precautions are taken.
These warnings mean that minor injuries may occur, if
no precautions are taken.
These warnings mean that damage to property may oc-
cur, if no precautions are taken.
These warnings contain references to safety-relevant information or
general safety measures.
These warnings do not refer to individual hazards or individual pre-
cautionary measures.
Procedures marked with this warning must be followed
exactly.

6 / 79 Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
KUKA.EthernetKRL 2.2
Notes These hints serve to make your work easier or contain references to further
information.
1.4 Terms used
Tip to make your work easier or reference to further information.
Term Description
Data stream Continuous sequences of data records of which the
end cannot be foreseen in advance. The individual
data records may be of any fixed type. The amount of
data records per unit of time (data rate) may vary. Only
sequential access to the data is possible.
EKI EthernetKRL interface
EOS End of stream (end string)
String that indicates the end of a data record
Ethernet Ethernet is a data network technology for local area
networks (LANs). It allows data to be exchanged
between the connected devices in the form of data
frames.
FIFO Methods used to process a data memory
First In First Out: the elements saved first are tak-
en first from the memory.
LastIn FirstOut: the elements saved last are taken
first from the memory.
LIFO
KLI KUKA Line Interface
Line bus for the integration of the system in the cus-
tomer network
KR C KUKA Robot Controller
KR C is the KUKA robot controller
KRL KUKA Robot Language
KRL is the KUKA robot programming language.
smartHMI Smart human-machine interface
KUKA smartHMI is the user interface of the KUKA sys-
tem software.
Socket Software interface that links IP addresses to port num-
bers.
TCP/IP Transmission Control Protocol
Protocol of the data exchange between devices of a
network. TCP constitutes a virtual channel between
two sockets in a network connection. Data can be
transmitted on this channel in both directions.
UDP/IP User Datagram Protocol
Connectionless protocol of the data exchange between
the devices of a network
IP Internet Protocol
The Internet protocol is used to define subnetworks by
means of physical MAC addresses.

7 / 79Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
1 Introduction
1.5 Trademarks
.NET Framework is a trademark of Microsoft Corporation.
Windows is a trademark of Microsoft Corporation.
XML Extensible Markup Language
Standard for creating machine-readable and human-
readable documents in the form of a specified tree
structure.
XPath XML Path Language
Language used to write and read sections of an XML
document
Term Description

9 / 79Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
2 Product description
2 Product description
2.1 Overview of EthernetKRL
Functions EthernetKRL is an add-on technology package with the following functions:
Data exchange via the EthernetKRL interface
Receiving XML data from an external system
Sending XML data to an external system
Receiving binary data from an external system
Sending binary data to an external system
Features Robot controller and external system as a client or server
Configuration of connections via XML-based configuration file
Configuration of “event messages”
Monitoring of connections by a ping on the external system
Reading and writing data from the Submit interpreter
Reading and writing data from the robot interpreter
Communication Data are transmitted via the TCP/IP protocol. It is possible to use the UDP/IP
protocol, but not recommended (connectionless network protocol, e.g. no data
loss detection).
The communication time depends on the actions programmed in KRL and the
data volume sent. Up to 2 ms package circulation time may be reached in
KRL, depending on the programming method.
2.2 Configuration of an Ethernet connection
Description The Ethernet connection is configured via an XML file. A configuration file
must be defined for each connection in the directory C:\KRC\ROBOTER\Con-
fig\User\Common\EthernetKRL of the robot controller. The configuration is
read in when initializing a connection.
Ethernet connections can be created and operated by the robot interpreter or
Submit interpreter. The channels can be used crosswise, e.g. a channel
opened in the Submit interpreter can also be operated by the robot interpreter.
The deletion of a connection can be linked to robot interpreter and Submit in-
terpreter actions or system actions.
2.2.1 Behavior in the event of a lost connection
Description The following properties and functions of the EKI ensure the received data can
be processed reliably:
A connection is automatically closed when reaching the limit of a data
memory.
A connection is automatically closed if a data reception error occurs.
The data memories continue to be read out with the connection closed.
If a connection is lost, it can be restored without any influence on the saved
data.
A lost connection can be indicated, for example, by a flag.
The error message for the error which caused a lost connection can be dis-
played on the smartHMI.

10 / 79 Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
KUKA.EthernetKRL 2.2
2.2.2 Monitoring a connection
Description A connection can be monitored by a ping on the external system (<ALIVE…/
> element in the connection configuration).
A flag or output can be set in the event of a successful connection, depending
on the configuration. The output or flag is set as long as the ping is regularly
sent and the connection to the external system is active. The output or flag is
deleted if the connection to the external system is aborted.
2.3 Data exchange
Overview The robot controller can receive data from an external system as well as send
data to an external system via EthernetKRL.
Data reception Basic sequence (marked in red) (>>> Fig. 2-1 ):
1. The external system sends data which are transmitted via a protocol and
received by the EKI.
2. The data are stored in a structured manner in a data memory.
3. The data are accessed from a KRL program in a structured manner. KRL
instructions are used to read the data and copy them into KRL variables.
Data trans-
mission
Basic sequence (marked in green) (>>> Fig. 2-1 ):
1. KRL instructions are used to write the data in a data memory in a struc-
tured manner.
2. A KRL instruction is used to read the data out of the memory.
3. EKI sends the data to the external system via a protocol.
2.4 Saving data
Description All data received are automatically saved and, in this way, are available to
KRL. XML and binary data are treated differently when saving them.
Fig. 2-1: System overview
It is possible to send data directly without first storing the data in a
memory.

11 / 79Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
2 Product description
Each data memory is implemented as a memory stack. The individual memo-
ries are read out in FIFO or LIFO mode.
XML data The received data are extracted and stored type-specifically in different mem-
ories (one memory per value).
Binary data The received data are not extracted or interpreted. Only one memory exists for
a connection in binary mode.
Read-out
methods
Data elements are taken out of the memory in the order in which they were
stored there (FIFO). The reverse method, in which the data element stored last
in the memory is taken out first, can be configured (LIFO).
Each memory is assigned a common maximum limit for the data which can be
saved. If the limit is exceeded, the Ethernet connection is immediately closed
to prevent the reception of further data. The data currently received are still
saved, i.e. the memory is increased by 1. The memories can still be further
processed. The connection can be re-opened via the EKI_OPEN() function.
Fig. 2-2: XML data memory
Fig. 2-3: Binary data memory

12 / 79 Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
KUKA.EthernetKRL 2.2
2.5 Client-server mode
Description The robot controller and external system are connected as a client and server.
The external system may be the client or server. The number of active con-
nections is limited to 16.
If the EKI is configured as a server, only an individual client can connect to the
server. If several connections are required, several servers should also be cre-
ated at the interface. It is possible to operate several clients and servers simul-
taneously within the EKI.
2.6 Protocol types
Description The transmitted data can be packed in different formats.
The following formats are supported:
Freely configurable XML structure
Binary data record of fixed length
Variable binary data record with end string
Fig. 2-4: Read-out method overview
Fig. 2-5: Client-server mode

13 / 79Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
2 Product description
The two binary variants cannot be operated simultaneously at the same con-
nection.
The following combinations are possible:
Examples
2.7 Event messages
Description The following events can be signaled by setting an output or flag:
Connection is active.
An individual XML element has arrived at the interface.
A complete XML structure or complete binary data record has arrived at
the interface.
(>>> 6.2.8 "Configuration of event messages" Page 36)
2.8 Error treatment
Description EthernetKRL provides functions for data exchange between the robot control-
ler and an external system.
Each of these functions returns values. These return values can be queried
and evaluated in the KRL program.
The following values are returned, depending on the function:
Error number
Number of elements still in the memory after the access.
Number of elements read out of the memory
Fig. 2-6: Protocol types
Connection CxC1 C2 C3 C4 C5
Binary, fixed
Binary, variable
XML
Fig. 2-7: Binary data of fixed length (10 bytes)
Fig. 2-8: Variable binary data with end string

14 / 79 Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
KUKA.EthernetKRL 2.2
Information on whether a connection exists
Time stamp of the data element taken from the memory
(>>> 6.2.7 "EKI_STATUS – Structure for function-specific return values"
Page 35)
A message is generated for each error on the smartHMI and in the EKI log-
book. The automatic generation of messages can be deactivated.

15 / 79Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
3 Safety
3 Safety
This documentation contains safety instructions which refer specifically to the
software described here.
The fundamental safety information for the industrial robot can be found in the
“Safety” chapter of the Operating and Programming Instructions for System In-
tegrators or the Operating and Programming Instructions for End Users.
The “Safety” chapter in the operating and programming instructions
must be observed. Death to persons, severe injuries or considerable
damage to property may otherwise result.

17 / 79Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
4 Installation
4 Installation
4.1 System requirements
Hardware KR C4 robot controller
External system
Software KUKA System Software 8.2 or 8.3
4.2 Installing or updating EthernetKRL
Preparation Copy software from CD to KUKA USB stick.
The software must be copied onto the stick with the file Setup.exe at the
highest level (i.e. not in a folder).
Precondition “Expert” user group
Procedure 1. Connect the USB stick to the robot controller or smartPAD.
2. In the main menu, select Start-up > Additional software.
3. Press New software. The entry EthernetKRL must be displayed in the
Name column and drive E:\ or K:\ in the Path column.
If not, press Refresh.
4. If the specified entries are now displayed, continue with step 5.
If not, the drive from which the software is being installed must be config-
ured first:
Press the Configuration button. A new window opens.
Select a line in the Installation paths for options area.
Note: If the line already contains a path, this path will be overwritten.
Press Path selection. The available drives are displayed.
Select E:\. (If stick connected to the robot controller.)
Or select K:\. (If stick connected to the smartPAD.)
Press Save. The window closes again.
The drive only needs to be configured once and then remains saved for
further installations.
5. Mark the entry EthernetKRL and click on Install. Answer the request for
confirmation with Yes.
6. Confirm the reboot prompt with OK.
7. Remove the stick.
8. Reboot the robot controller.
LOG file A LOG file is created under C:\KRC\ROBOTER\LOG.
It is advisable to archive all relevant data before updating a software
package.
Recommendation: Always use KUKA sticks. Data may
be lost if sticks from other manufacturers are used.

18 / 79 Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
KUKA.EthernetKRL 2.2
4.3 Uninstalling EthernetKRL
Precondition “Expert” user group
Procedure 1. In the main menu, select Start-up > Additional software. All additional
programs installed are displayed.
2. Mark the entry EthernetKRL and click on Uninstall. Reply to the request
for confirmation with Yes. Uninstallation is prepared.
3. Reboot the robot controller. Uninstallation is resumed and completed.
LOG file A LOG file is created under C:\KRC\ROBOTER\LOG.
It is advisable to archive all relevant data before uninstalling a soft-
ware package.

19 / 79Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
5 Configuration
5 Configuration
5.1 Network connection via the KLI of the robot controller
Description A network connection must be established via the KLI of the robot controller in
order to exchange data via Ethernet.
The following Ethernet interfaces are available as options at the customer in-
terface of the robot controller, depending on the specification:
Interface X66 (1 slot)
Interface X67.1-3 (3 slots)
Detailed information about network configuration via the KUKA Line
Interface (KLI) of the robot controller is contained in the Operating
and Programming Instructions for System Integrators.
Further information on the Ethernet interfaces can be found in the op-
erating or assembly instructions for the robot controller.
Table of contents
Other Kuka Robotics manuals

Kuka
Kuka LBR iisy User manual

Kuka
Kuka KR 30-3 Operation instructions

Kuka
Kuka KR QUANTEC extra User manual

Kuka
Kuka ready2 educate User manual

Kuka
Kuka iiQKA LBR iisy User manual

Kuka
Kuka KRC4 User manual

Kuka
Kuka KR AGILUS sixx User manual

Kuka
Kuka KR 30-2 User manual

Kuka
Kuka KR 300-2 PA User manual

Kuka
Kuka KR 350 Guide
Popular Robotics manuals by other brands

Sparkfun Electronics
Sparkfun Electronics RedBot Getting started

SunFounder
SunFounder Sloth Learning Kit manual

QB Robotics
QB Robotics N.1 qb SoftHand Research 24 V General manual

Pololu
Pololu 3pi Robot user guide

Parallax
Parallax 28195 quick start guide

LEXIBOOK
LEXIBOOK Powerman Kid ROB90EN instruction manual