Issued: 19.12.2012 Version: KST EthernetKRL 2.2 V1 en (PDF)
7 Examples
Program
7.2.2
BinaryStream configuration example
The EKI is configured as a client. Only binary data records with a maximum
length of 64 bytes and the element name "Buffer" can be received via this con-
nection. The end of the binary data record must be indicated with the end
string CR, LF. $FLAG[1] is set when the interface has received this element.
Detailed information on the CAST_TO() and CAST_FROM() com-
mands can be found in the CREAD/CWRITE documentation.
1 DEF BinaryFixed( )
2 Declaration
3 INI
4 Initialize sample data
5
6 RET=EKI_Init("BinaryFixed")
7 RET=EKI_Open("BinaryFixed")
8
9 OFFSET=0
10 CAST_TO(Bytes[],OFFSET,34.425,674345,"R",TRUE)
11
12 RET = EKI_Send("BinaryFixed",Bytes[])
13
14 WAIT FOR $FLAG[1]
15 RET=EKI_GetString("BinaryFixed","Buffer",Bytes[])
16 $FLAG[1]=FALSE
17
18 OFFSET=0
19 CAST_FROM(Bytes[],OFFSET,valueReal,valueInt,
valueChar[],valueBool)
20
21
22 RET=EKI_Close("BinaryFixed")
23 RET=EKI_Clear("BinaryFixed")
24 END
Line
Description
4
Initialization of KRL variables by the assignment of values
6
EKI_Init() initializes the channel used by the interface to con-
nect to the external system.
7
EKI_Open() opens the channel and connects to the server.
9, 10
CAST_TO writes the values in the Bytes[] CHAR array.
12
EKI_Send() sends the Bytes[] CHAR array to the external sys-
tem.
14 … 16
$FLAG[1] indicates the reception of the configured data ele-
ment.
EKI_GetString accesses the memory and copies the data into
the Bytes[] CHAR array.
$FLAG[1] is reset again.
18, 19
CAST_FROM reads the values out of the Bytes[] CHAR array
and copies them type-specifically into the specified variables.
22
EKI_Close() closes the channel.
23
EKI_Clear() clears the channel.
For communication with the robot controller, the appropriate example
data must have been set in the server program; in this case
BinaryS-
tream
.
Summary of Contents for KUKA.EthernetKRL 2.2
Page 8: ...8 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Page 16: ...16 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Page 20: ...20 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Page 40: ...40 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Page 52: ...52 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Page 58: ...58 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Page 76: ...76 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...
Page 79: ...79 79 Issued 19 12 2012 Version KST EthernetKRL 2 2 V1 en PDF KUKA EthernetKRL 2 2 ...