I'm trying to communicate between a Linux PC and KRC4, sending xml via EKI.
I can get a message from KUKA > Linux no problem, but struggle with the other way around.
In the code below, I hit the line RET=EKI_GetReal("XmlTransmit","Robot/Axis/Speed",valueSpeed) and get the error "Access to empty elementmemory"
Are there any debugging things I can do? How can I check the XML packet has been sent/received?
Thanks!
Code
;FOLD Declaration
DECL REAL SPEED
DECL EKI_STATUS RET
REAL valueSpeed
CHAR sendBytes[4]
;ENDFOLD (Declaration)
;-- We expect the sent and received data to look something like the below
;FOLD Communicated data
;------------------------------------------
; Data transmitted: binary version - cast int array to bytes[4] array
; Data transmitted: (XML version)
; <Robot>
; <Data>
; <LineNum>1234
; </LineNum>
; </Data>
; </Robot>
;--------------------
; Data received:
; <Robot>
; <Axis>
; <Speed>25.0 </Speed>
; </Axis>
; </Robot>
;-------------------------------------------
;ENDFOLD (Communicated data)
;-- Initialisation
;FOLD INI;%{PE}
;FOLD BASISTECH INI
GLOBAL INTERRUPT DECL 3 WHEN $STOPMESS==TRUE DO IR_STOPM ( )
INTERRUPT ON 3
BAS (#INITMOV,0 )
;ENDFOLD (BASISTECH INI)
;FOLD USER INI
;Make your modifications here
;ENDFOLD (USER INI)
;ENDFOLD (INI)ENDEND
;FOLD Initialize data
valueSpeed = 0.0
;ENDFOLD (Initialize data)
;-- Open connection and send/receive data
RET=EKI_Init("XmlTransmit")
RET=EKI_Open("XmlTransmit")
;FOLD Write data to connection
; Binary version:
sendBytes[1] = 1
sendBytes[2] = 2
sendBytes[3] = 3
sendBytes[4] = 6
RET=EKI_Send("XmlTransmit",sendBytes[])
;ENDFOLD (Write data to connection)
;-------------------------------------------
;FOLD Get received sensor data
; Get real value in <Speed = "" />
RET=EKI_GetReal("XmlTransmit","Robot/Axis/Speed",valueSpeed)
SPEED = valueSpeed
;-- Do something with SPEED!
;ENDFOLD (Get received sensor data)
RET=EKI_Close("XmlTransmit")
RET=EKI_Clear("XmlTransmit")
Display More