Debugging EKI Error: Access to empty elementmemory

  • 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!


  • I think I found the issue... I put a WAIT command before the problematic line and it worked...!

    The question still stands though, is there an easy way to debug this, or to catch if I've requested info that isn't yet available?

  • you are reading blindly.... without checking if anything was received. or if received message contains value for "Robot/Axis/Speed"

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • Thanks for the reply. Totally beginner to this - going off examples.


    What's the best practice for checking something was received? I've just been toying with ON_ERROR_PROCEED in case nothing was yet received, but that doesn't feel right.

  • examples show how to do this.... they use interrupt to sense flag when message is received

    but you don't have to use an interrupt... it is possible to utilize WAIT as you already did.


    the key part is to format XML configuration to tell you when message is received. for example here we use $FLAG[998]


    Code
    <RECEIVE>
        <XML>
            <ELEMENT Tag="ToKRC/Command" Type="STRING"/>   <!-- data -->            
            <ELEMENT Tag="ToKRC/SpeedLimit" Type="INT"/>   <!-- data -->    
            <ELEMENT Tag="ToKRC/Abort" Type="BOOL"/>       <!-- data -->    
            <ELEMENT Tag="ToKRC" Set_Flag="998"/>          <!-- set $FLAG[998] when data received -->
        </XML>
    </RECEIVE>


    then in your program you can use


    WAIT FOR $FLAG[998]


    instead of some arbitrary time.


    or you could also make it a bit more complex, for example check if response arrived within some time window.;


    if you are transmitting continuously, make sure to reset that flag. otherwise you will not know when the net message is received.


    the other thing that can be done is use CHECK_BUFFER() and read while something is in the receive buffer, and skip if nothing there

    1) read pinned topic: READ FIRST...

    2) if you have an issue with robot, post question in the correct forum section... do NOT contact me directly

    3) read 1 and 2

  • I've come back to this to add a timeout.
    panic mode - I've used timers in a different way before ($TIMER_STOP[19] = FALSE etc). Your method looked much more elegant, but could find any documentation, and I got errors when using WAIT FOR TIMER_LIMIT[4.565]

    The error was either ARRAY VARIABLE NOT DECLARED (if an integer), or EXPRESSION NOT EQUAL TO INT (if a float).


    Am I missing something?

Advertising from our partners