Page 1
KUKA Roboter GmbH KUKA System Technology KUKA.EthernetKRL 2.2 For KUKA System Software 8.2 and 8.3 Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
Page 2
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.
Contents Contents Introduction ....................Target group ......................Industrial robot documentation ................... Representation of warnings and notes ..............Terms used ........................ Trademarks ........................ Product description ..................Overview of EthernetKRL ..................Configuration of an Ethernet connection ..............2.2.1 Behavior in the event of a lost connection ............2.2.2 Monitoring a connection ..................
Page 4
Checking a function for errors ................9.4.6 Clearing, locking, unlocking and checking a memory ........... KUKA Service ....................10.1 Requesting support ....................10.2 KUKA Customer Support ................... Index ......................Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF) 4 / 79...
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.
KR C is the KUKA robot controller 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.
1 Introduction Term Description 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 Trademarks .NET Framework is a trademark of Microsoft Corporation. Windows is a trademark of Microsoft Corporation.
2 Product description Product description Overview of EthernetKRL EthernetKRL is an add-on technology package with the following functions: Functions Data exchange via the EthernetKRL interface Receiving XML data from an external system Sending XML data to an external system ...
KUKA.EthernetKRL 2.2 2.2.2 Monitoring a connection A connection can be monitored by a ping on the external system (<ALIVE…/ Description > element in the connection configuration). A flag or output can be set in the event of a successful connection, depending on the configuration.
Page 11
2 Product description Each data memory is implemented as a memory stack. The individual memo- ries are read out in FIFO or LIFO mode. The received data are extracted and stored type-specifically in different mem- XML data ories (one memory per value). Fig.
KUKA.EthernetKRL 2.2 Fig. 2-4: Read-out method overview Client-server mode The robot controller and external system are connected as a client and server. Description The external system may be the client or server. The number of active con- nections is limited to 16.
2 Product description Fig. 2-6: Protocol types The two binary variants cannot be operated simultaneously at the same con- nection. The following combinations are possible: Connection C Binary, fixed Binary, variable Examples Fig. 2-7: Binary data of fixed length (10 bytes) Fig.
Page 14
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.
3 Safety 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.
Installing or updating EthernetKRL It is advisable to archive all relevant data before updating a software package. Copy software from CD to KUKA USB stick. Preparation The software must be copied onto the stick with the file Setup.exe at the highest level (i.e.
KUKA.EthernetKRL 2.2 Uninstalling EthernetKRL It is advisable to archive all relevant data before uninstalling a soft- ware package. “Expert” user group Precondition 1. In the main menu, select Start-up > Additional software. All additional Procedure programs installed are displayed.
A network connection must be established via the KLI of the robot controller in Description order to exchange data via Ethernet. 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.
6 Programming Programming Configuring an Ethernet connection An Ethernet connection is configured via an XML file. A configuration file must Overview be defined for each connection in the directory C:\KRC\ROBOTER\Config\Us- er\Common\EthernetKRL of the robot controller. XML files are case-sensitive. Upper/lower case must be taken into consideration.
Page 22
KUKA.EthernetKRL 2.2 Element Description IP address of the external system if it is defined as a server (TYPE = server) The IP address is ignored if TYPE = client. PORT Port number of the external system if it is defined as a server (TYPE = server) ...
Page 23
6 Programming Element Attribute Description ALIVE Set_Out Sets an output or a flag for a successful con- nection (optional) Set_Flag Number of the output: 1 … 4,096 Number of the flag: 1 … 1,025 The output or flag is set as long as a connec- tion to the external system is active.
KUKA.EthernetKRL 2.2 Example <CONFIGURATION> <EXTERNAL> <IP>172.1.10.5</IP> <PORT>60000</PORT> <TYPE>Server</TYPE> </EXTERNAL> <INTERNAL> <ENVIRONMENT>Program</ENVIRONMENT> <BUFFERING Mode="FIFO" Limit="10"/> <BUFFSIZE Limit="16384"/> <TIMEOUT Connect="60000"/> <ALIVE Set_Out="666" Ping="200"/> <IP>192.1.10.20</IP> <PORT>54600</PORT> <PROTOCOL>TCP</PROTOCOL> <Messages Display="disabled" Logging="error"/> </INTERNAL> </CONFIGURATION> 6.1.2 XML structure for data reception The configuration depends on whether XML data or binary data are received.
Page 25
6 Programming Element Attribute Description ELEMENT Set_Out Sets an output or flag after receiving the ele- ment (optional) Set_Flag Number of the output: 1 … 4,096 Number of the flag: 1 … 1,025 ELEMENT Mode Method used to process a data record in the data memory FIFO: First In First Out ...
6 Programming 6.1.4 Configuration according to the XPath schema If XML is used to exchange data, it is necessary for the exchanged XML doc- Description uments to be structured in the same way. EthernetKRL uses the XPath sche- ma to write and read the XML documents. The following cases are to be distinguished for XPath: Writing and reading elements ...
6 Programming By setting a flag or an output, it can be indicated that a certain data el- ement or a complete data record has been received (Set_Flag or Set_Out element in the XML structure for data reception). Example: Interrupt of the KRL program by WAIT FOR $FLAG[ (>>>...
KUKA.EthernetKRL 2.2 “Submit” config- uration Fig. 6-2: “Submit” connection configuration With this configuration, a connection is deleted after the following actions: Cancel Submit interpreter. Reconfigure I/Os. The driver is reloaded when reconfiguring the I/Os, i.e. all initializa- tions are deleted.
6 Programming DEF Connection() RET=EKI_Init("Connection") RET=EKI_Open("Connection") Write data, send data or get received data RET=EKI_Close("Connection") RET=EKI_Clear("Connection") Line Description EKI_Init() initializes the channel used by the interface to con- nect to the external system. EKI_Open() opens the channel. KRL instructions used to write data in the memory, send data or access received data EKI_Close() closes the channel.
Page 32
KUKA.EthernetKRL 2.2 XML data Sending the complete XML structure example Saved XML structure for data transmission: <Robot> <ActPos X="1000.12"></ActPos> <Status>12345678</Status> </Robot> Programming: DECL EKI_STATUS RET RET=EKI_Send("Channel_1","Robot") Sent XML structure: <Robot> <ActPos X="1000.12"></ActPos> <Status>12345678</Status> </Robot> Sending part of the XML structure Saved XML structure for data transmission (not used in the case of direct ...
6 Programming DECL EKI_STATUS RET CHAR Bytes[10] OFFSET=0 CAST_TO(Bytes[],OFFSET,91984754,913434.2,TRUE,"X") RET=EKI_Send("Channel_1",Bytes[]) Sent data: "r?{ ? _I X" Direct sending of a binary data record with end string Configured raw data: <RAW> <ELEMENT Tag="Buffer" Type="STREAM" EOS="65,66" /> </RAW> Programming: DECL EKI_STATUS RET CHAR Bytes[64] Bytes[]="Stream ends with:"...
Page 34
KUKA.EthernetKRL 2.2 ; Declaration INT i DECL EKI_STATUS RET CHAR valueChar[256] BOOL valueBOOL ; Initialization FOR i=(1) TO (256) valueChar[i]=0 ENDFOR valueBOOL=FALSE RET=EKI_GetString("Channel_1","Sensor/Message",valueChar[]) RET=EKI_GetBool("Channel_1","Sensor/Status/IsActive",valueBOOL) Received data: valueChar[] "Example message" valueBOOL[] TRUE Binary data Reading out a binary data record of fixed length (10 bytes)
6 Programming ; Declaration INT i DECL EKI_STATUS RET CHAR Bytes[64] ; Initialization FOR i=(1) TO (64) Bytes[i]=0 ENDFOR RET=EKI_GetString("Channel_1","Buffer",Bytes[]) 6.2.6 Deleting received data A distinction is to be made between the following cases when deleting re- Description ceived data: Deletion with EKI_Clear(): the Ethernet connection is terminated and all ...
KUKA.EthernetKRL 2.2 Element Description Connected Indicates whether a connection exists TRUE = connection present FALSE = connection interrupted Counter Time stamp for received data packets Data packets arriving in the memory are numbered consecutively in the order in which they are stored in the memory.
6 Programming Event output Fig. 6-4: Event output (active connection) $OUT[23] is set as long as the connection to the external system is active. $OUT[23] is reset when the connection is no longer active. The connection can be restored only with the EKI_OPEN() function. Event flag Fig.
KUKA.EthernetKRL 2.2 Example RET=EKI_Lock("MyChannel") RET=EKI_Get...() RET=EKI_Get...() RET=EKI_Get...() RET=EKI_Unlock("MyChannel") 6.2.10 Processing incomplete data records Under certain circumstances an external system may send incomplete data records. Individual XML elements are either empty or missing entirely, with the result that data from various data packets are present in one memory layer.
7 Examples Examples Application examples EthernetKRL comprises application examples which can be used to establish Overview communication between a server program and the robot controller. The soft- ware can be found in the directory DOC\Example on the CD supplied. The software consists of the following components: Component Folder EthernetKRL_Server.exe server program...
KUKA.EthernetKRL 2.2 7.1.2 Server program user interface The server program enables the communication between an external system Description and the robot controller to be tested by establishing a stable connection to the robot controller. The server program has the following functions: Sending and receiving data (automatically or manually) ...
7 Examples Item Description Start button Data exchange between the server program and robot controller is evaluated. The first incoming connection request is linked and used as a communication adapter. Menu button for setting the communication parameters (>>> 7.1.3 "Setting communication parameters in the server pro- gram"...
KUKA.EthernetKRL 2.2 Element Description Example Select example data. Xml: XML data BinaryFixed: binary data of fixed length BinaryStream: variable binary data stream with end string Default value: xml Autoresponder Select communication mode. Autoreply: The server automatically responds to ...
7 Examples Detailed information on the CAST_TO() and CAST_FROM() com- mands can be found in the CREAD/CWRITE documentation. Program DEF BinaryFixed( ) Declaration Initialize sample data RET=EKI_Init("BinaryFixed") RET=EKI_Open("BinaryFixed") OFFSET=0 CAST_TO(Bytes[],OFFSET,34.425,674345,"R",TRUE) RET = EKI_Send("BinaryFixed",Bytes[]) WAIT FOR $FLAG[1] RET=EKI_GetString("BinaryFixed","Buffer",Bytes[]) $FLAG[1]=FALSE OFFSET=0 CAST_FROM(Bytes[],OFFSET,valueReal,valueInt, valueChar[],valueBool) RET=EKI_Close("BinaryFixed") RET=EKI_Clear("BinaryFixed")
KUKA.EthernetKRL 2.2 7.2.4 XmlServer configuration example If the interface has been configured as a server, the server program cannot be used on the external system. A simple client can be imple- mented with Windows HyperTerminal. The EKI is configured as a server. $FLAG[1] is set as long as a connection to the external system exists.
Page 49
7 Examples The EKI is configured as a client. Robot data are sent, sensor data received and then $FLAG[1] awaited. $FLAG[1] indicates that the sensor data have been read out. It is configured in the XML file that $FLAG[998] is set when the interface has received all sensor data.
Page 50
KUKA.EthernetKRL 2.2 Program DEF XmlCallBack( ) Declaration Communicated data Define callback RET=EKI_Init("XmlCallBack") RET=EKI_Open("XmlCallBack") Write data to connection RET = EKI_Send("XmlCallBack","Robot") ;wait until data read WAIT FOR $FLAG[1] RET=EKI_Close("XmlCallBack") RET=EKI_Clear("XmlCallBack") DEF GET_DATA() Declaration Initialize sample data Get received sensor data Signal read...
8 Diagnosis Diagnosis Displaying diagnostic data 1. Select Diagnosis > Diagnostic monitor in the main menu. Procedure 2. Select the EKI (EthernetKRL) module in the Module field. Description Name Description Total available memory (bytes) Total memory Used memory (bytes) Allocated memory Number of connections initialized by the robot Robot program con- interpreter...
Page 54
If no other type of program- ming or configuration is possible, the memory can be increased in consulta- tion with KUKA Roboter GmbH. (>>> 9.2 "Increasing the memory" Page 59) A file could not be found or...
Page 55
8 Diagnosis Message text Cause Remedy An Ethernet connection Check configuration of Create server failed configured as a server connection parameters (IP could not be created. elements, PORT). Error when initializing the Check configuration of Initialization of Ethernet Ethernet connection connection parameters (IP parameters failed elements, PORT).
Page 56
If no other configuration is possible, the memory can be increased in consulta- tion with KUKA Roboter GmbH. (>>> 9.2 "Increasing the memory" Page 59) An error in the XML struc- Check the XML structure in...
Page 57
8 Diagnosis Message text Cause Remedy 1024 An XML document Check the XML document Error while reading received from the external sent by the external sys- received XML data system does not corre- tem. spond to the XPath schema. 1280 The data memory is Evaluate the return value Limit of element storage...
1 … 65,534 bytes Default value: Predefined by the system Increasing the memory The memory may be increased only in consultation with KUKA Robot- er GmbH. (>>> 10 "KUKA Service" Page 69) If the available memory is insufficient, it is recommended to check the pro- Description gramming method in KRL as well as the configuration.
KUKA.EthernetKRL 2.2 3. Save the change and close the file. Deactivating message output and message logging It is recommended for automatic message output on the smartHMI to be de- Description activated in the following cases: Runtime errors occur. The EKI is used in the Submit interpreter.
9 Appendix RET = EKI_Open(CHAR[]) Function Opens an initialized channel If the EthernetKRL interface is configured as a client, the interface connects to the server. If the EthernetKRL interface is configured as a server, the interface waits for the connection. Parameter Type: CHAR Name of channel...
KUKA.EthernetKRL 2.2 9.4.3 Writing data RET = EKI_SetReal(CHAR[], CHAR[], REAL) Function Writes a floating point value in a memory Parameter 1 Type: CHAR Name of the open channel Parameter 2 Type: CHAR Name of the position in the XML structure...
9 Appendix RET = EKI_SetFrame(CHAR[], CHAR[], FRAME) Parameter 3 Type: FRAME Value written in the memory Type: EKI_STATUS Return values of the function (>>> "Return values" Page 36) Example RET= EKI_SetFrame("Channel_1", "Root/BASE", {X 0.0, Y 0.0, Z 0.0, A 0.0, B 0.0, C 0.0}) RET = EKI_SetString(CHAR[], CHAR[], CHAR[]) Function Writes a string in a memory...
Page 64
KUKA.EthernetKRL 2.2 RET = EKI_GetBoolArray(CHAR[], CHAR[], BOOL[]) Function Reads a Boolean value out of the memory and copies the value into the array transferred by the KRL pro- gram Values are read until the array is full or no element is present anymore.
Page 65
9 Appendix RET = EKI_GetIntArray(CHAR[], CHAR[], Int[]) Type: EKI_STATUS Return values of the function (>>> "Return values" Page 36) Example RET = EKI_GetIntArray("Channel_1", "Root/Numbers/ One", MyInteger[]) RET = EKI_GetReal(CHAR[], CHAR[], Real) Function Reads a floating point value out of a memory Parameter 1 Type: CHAR Name of the open channel...
Page 66
KUKA.EthernetKRL 2.2 RET = EKI_GetString(CHAR[], CHAR[], CHAR[]) Parameter 3 Type: CHAR String read out of the memory Maximum number of characters: 3,600 Type: EKI_STATUS Return values of the function (>>> "Return values" Page 36) XML example RET = EKI_GetString("Channel_1", "Root/Message",...
9 Appendix 9.4.5 Checking a function for errors EKI_CHECK( EKI_STATUS, EKrlMsgType, CHAR[]) Function Checks whether an error occurred during execution of an EthernetKRL function: The error number is read out and the correspond- ing message is displayed on the smartHMI. (Pa- rameter 1) Optional: If the channel name is specified, it is ...
Page 68
KUKA.EthernetKRL 2.2 RET = EKI_Lock(CHAR[]) Parameter Type: CHAR Name of channel Type: EKI_STATUS Return values of the function (>>> "Return values" Page 36) RET = EKI_Unlock(CHAR[]) Function Enables the processing of received data, i.e. the data are stored in the memory again.
Description of the problem, duration and frequency of the fault 10.2 KUKA Customer Support KUKA Customer Support is available in many countries. Please do not hesi- Availability tate to contact us if you have any questions. Ruben Costantini S.A. (Agency)
Page 70
KUKA.EthernetKRL 2.2 KUKA Automatisering + Robots N.V. Belgium Centrum Zuid 1031 3530 Houthalen Belgium Tel. +32 11 516160 Fax +32 11 526794 info@kuka.be www.kuka.be KUKA Roboter do Brasil Ltda. Brazil Travessa Claudio Armando, nº 171 Bloco 5 - Galpões 51/52 Bairro Assunção...
Page 71
10 KUKA Service KUKA Automatisme + Robotique SAS France Techvallée 6, Avenue du Parc 91140 Villebon S/Yvette France Tel. +33 1 6931660-0 Fax +33 1 6931660-1 commercial@kuka.fr www.kuka.fr KUKA Robotics India Pvt. Ltd. India Office Number-7, German Centre, Level 12, Building No. - 9B...
Page 72
47100 Puchong Selangor Malaysia Tel. +60 3 8061-0613 or -0614 Fax +60 3 8061-7386 info@kuka.com.my KUKA de México S. de R.L. de C.V. Mexico Progreso #8 Col. Centro Industrial Puente de Vigas Tlalnepantla de Baz 54020 Estado de México Mexico Tel.
Page 73
Ul. Porcelanowa 10 40-246 Katowice Poland Tel. +48 327 30 32 13 or -14 Fax +48 327 30 32 26 ServicePL@kuka-roboter.de KUKA Sistemas de Automatización S.A. Portugal Rua do Alto da Guerra n° 50 Armazém 04 2910 011 Setúbal Portugal Tel.
Page 74
6000 Port Elizabeth South Africa Tel. +27 41 391 4700 Fax +27 41 373 3869 www.jendamark.co.za KUKA Robot Automation Taiwan Co., Ltd. Taiwan No. 249 Pujong Road Jungli City, Taoyuan County 320 Taiwan, R. O. C. Tel. +886 3 4331988 Fax +886 3 4331948 info@kuka.com.tw...
Page 75
10 KUKA Service KUKA Robotics Hungaria Kft. Hungary Fö út 140 2335 Taksony Hungary Tel. +36 24 501609 Fax +36 24 477031 info@kuka-robotics.hu KUKA Robotics Corporation 51870 Shelby Parkway Shelby Township 48315-1787 Michigan Tel. +1 866 873-5852 Fax +1 866 329-5852 info@kukarobotics.com...
Page 78
Saving data 10 Server mode 12, 31 Server program 41 Server program, setting communication parame- ters 43 Server program, user interface 42 Service, KUKA Roboter 69 smartHMI 6 Socket 6 Software 17 Support request 69 System requirements 17 Target group 5...
Need help?
Do you have a question about the KUKA.EthernetKRL 2.2 and is the answer not in the manual?
Questions and answers