Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
6 Programming
It should be taken into account during programming whether the interface is
configured as a server or client.
Server mode
EKI_Open() sets the interface (= server) to a listening state if the external sys-
tem is configured as a client. The server waits for the connection request of a
client without interruption of the program run. If the <TIMEOUT Connect="…"/
> element is not assigned data in the configuration file, the server waits until a
client requests a connection.
A connection request by a client is indicated by access to the interface or by
an event message, e.g. via the <ALIVE SET_OUT="..."/> element.
An event flag or output has to be programmed, e.g. WAIT FOR $OUT[...], if the
program run is to be interrupted as long as the server waits for the connection
request.
Client mode
EKI_Open() interrupts the program run until the connection to the external sys-
tem is active if the external system is configured as a server. EKI_Close() clos-
es the connection to the external server.
6.2.4
Sending data
Description
Depending on the configuration and programming, the following data can be
sent with EKI_Send():
Complete XML structure
Partial XML structure
XML data directly as string
Binary data record with end string (EOS) directly as string
Binary data record of fixed length directly as string
Binary data records of fixed length must be read into the KRL program with
CAST_TO(). Only data of REAL type (4 bytes) are legible, not Double.
1 DEF Connection()
...
2 RET=EKI_Init("Connection")
3 RET=EKI_Open("Connection")
...
4 Write data, send data or get received data
...
5 RET=EKI_Close("Connection")
6 RET=EKI_Clear("Connection")
...
7 END
Line
Description
2
EKI_Init() initializes the channel used by the interface to con-
nect to the external system.
3
EKI_Open() opens the channel.
4
KRL instructions used to write data in the memory, send data
or access received data
5
EKI_Close() closes the channel.
6
EKI_Clear () deletes the channel.
It is recommended not to use EKI_Close() in server mode. In server
mode, the channel is closed from the external client.
Detailed information on the CAST_TO() command can be found in
the CREAD/CWRITE documentation.
Содержание KUKA.EthernetKRL 2.2
Страница 8: ...8 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Страница 16: ...16 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Страница 20: ...20 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Страница 40: ...40 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Страница 52: ...52 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Страница 58: ...58 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Страница 76: ...76 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Страница 79: ...79 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...