Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Behavior with multiple API calls to the same instance of RoboDK.

#2
I've got some more information now.

For troubleshooting, I started calling
Code:
RDK.COM.close() # RDK = robolink.Robolink()
在Python API at least 2 seconds before attempting to connect to the C API. This should prevent any complications.

I am now seeing what I believe are 2 possibly related issues.

Issue 1
When the C API starts, I see "The RoboDK API is connected!" (in_RoboDK_connect_smart) and then it just stops there without executing any more of my code. Tracing this back, it looks like I callRoboDK_getItem(), which succeeds 3 times, getting the following items:
- ROBOT
- FRAME
- OBJECT
On the 4th call, it attempts to get many targets, but after getting the item, it calls_RoboDK_check_status(inst).In that function, it followselse if (status < 100), calls_RoboDK_recv_Line(inst, strProblems), and hangs there there is no crash, exception, or error. It just stops. In this routine, I am attempting to get many targets, the last of which doesn't exist, so will not be valid, which indicates that the routine is done.

What is really weird is that if I start and restart it several times, it sometimes works.


Issue 2
In this case, the C API starts successfully and executes 100s of commands successfully. Unfortunately, it eventually just hangs. I have traced this back to a call toRoboDK_getItem()for a target. I believe that it is always (or nearly always) happening on a target that does not exist. My intent is to check whether the target exists by usingItem_Valid()on the next line, but it seems that it just gets stuck when targets don't exist.

It's a little hard for me to tell due to how my code works right now, but I am pretty sure that it often successfully gets targets that don't exist and recognizes them as invalid (which is the behavior I intended to use).




Is there something weird happening when trying to return NULL through the API that could cause intermittent failure?


Messages In This Thread
RE: Behavior with multiple API calls to the same instance of RoboDK. - bysig.johnnson- 01-20-2023, 12:39 AM



Users browsing this thread:
1 Guest(s)