48 / 79 Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
KUKA.EthernetKRL 2.2
7.2.4 XmlServer configuration example
The EKI is configured as a server. $FLAG[1] is set as long as a connection to
the external system exists.
XML file
Program
7.2.5 XmlCallback 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.
<ETHERNETKRL>
<CONFIGURATION>
<EXTERNAL>
<TYPE>Client</TYPE>
</EXTERNAL>
<INTERNAL>
<IP>x.x.x.x</IP>
<PORT>54600</PORT>
<ALIVE Set_Flag="1" />
</INTERNAL>
</CONFIGURATION>
<RECEIVE>
<XML>
<ELEMENT Tag="Sensor/A" Type="BOOL" />
</XML>
</RECEIVE>
<SEND>
<XML>
<ELEMENT Tag="Robot/B" />
</XML>
</SEND>
</ETHERNETKRL>
1 DEF XmlServer( )
2 Declaration
3 INI
4
5 RET=EKI_Init("XmlServer")
6 RET=EKI_Open("XmlServer")
7
8 ; wait until server is conntected
9 wait for $FLAG[1]
10 ; wait until server is deconnected
11 wait for $FLAG[1]==FALSE
12
13 RET=EKI_Clear("XmlServer")
14 END
Line Description
5 EKI_Init() initializes the channel used by the external system
to connect to the interface.
6 EKI_Open() opens the channel.
9 $FLAG[1] is set when the external client has connected suc-
cessfully to the server.
11 Since the interface is configured as a server, the robot control-
ler expects the channel to be closed by the external client. In
this case, $FLAG[1] is deleted.
13 EKI_Clear() clears the channel.
For communication with the robot controller, the appropriate example
data have to be set in the server program; in this case Xml.