Kuka Ready2_animate - Str value invalid

  • Hello,


    I'm working with Ready2_animate and have a problem running my programs. Sometimes (and not reproducible) this error (see screenshot) appears and I can't run the animations anymore. Does anyone came across this error too?


    I'm not sure if this is the case, but sometimes I unload the previously loaded emily-file and then it works, so I wonder, if the cache of Ready2_animate is full (or something like this). In another post, I red, that there is a max of 50k entries per path table. Could this be the error? Is there a command, which clears all previously loaded path tables? A restart of the robot did not help.


    The code in the screenshot is generated code, not code I have written.


  • are you sure structure element .STR[] is initialized?

    The code is generated. All I do is creating the program using the KRL Editor on the SmartPad where I do 3 things:


    - Load the path table (emily file)

    - Go to the beginning of the path table

    - Run the path table


    Since the code is generated, I guess it is syntactically correct and properly initialized.

  • it does not matter if code is generated or not...

    important part is that code works correctly and all the time.

    clearly it does not do that which is why you got the message.

    so if you want it to work correctly all the time, you need to trace the problem and fix the code.


    you assume that some sample code you are provided with is bullet proof. but likely reality is that code you run is just a proof of concept.

    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

  • The first thing to check, when this error occurs, is the value of R2A$_PT_REG[I].STR. This will be a bit difficult, since I is a local variable, and thus not accessible from the VarCor.


    If R2A$_PT_REG[] is declared in a .DAT file, then you can check its contents by filling in the index by hand, but that's a rough check. Your best option is to move the DECL INT I from the .SRC to the .DAT file and give it an initial value. Hopefully R2A$... is declared similarly. Then, when this error recurs, take an Archive before doing anything else, and the Archive will capture the status of the variables at that moment in time.

  • local variables can be monitored from VarCor (single variable monitor) but downside is that this requires pausing robot program before advance run pointer reaches end of subroutine.

    complication here is checking of STR[] is initialized since it is not just an element of a structure but also that structure is an array element. in other words index value is changing and cannot be hardcoded. to check if variable is initialized one need to use function VARSTATE which expects string variable as a parameter. so the proper way is to first use SWRITE before calling VARSTATE. this is not the only option but it is an example of what could/should be done. but this is only the first step... to catch the problem. more work is needed to see if array is properly bound etc. so clearly this is not robust code yet.



    another option is to simply check string length. this is not the same as checking if character array is initialized but it would be simpler to add and it should work.


    for example insert following code between lines 96 and 97


    Code
    DECL INT n
    n=StrLen(R2A$_PT_REG[I].Str[])
    if n<=0 then
      MsgQuit("Problem found...Now you need to deal with it. I=%1",,I)
    endif

    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 replies. I didn't want to dive into the generated code, since the workflow for ready2_animate should not require this. But with the help of other forums I found the solution and I will post it here, if someone comes across the same issue.


    If one loads a path table, it is persisted in this file: `KRC:\R1\TP\ready2_animate\Ready2_Animate_Globals.dat` (see attached screenshot)


    So, even if one restarts the robot, the path tables will still be loaded. You need to explicitly unload the path table in your KRL Program.

    To get rid of the error, I unload all previously loaded tables and in a new program, I unload the path table after the animation has been run. If an animation is interrupted during the execution and the program does not reach the point, where the table is unloaded, I use another little program which just unloads this particular table.

Advertising from our partners