Robotstudio hangs unexpectedly

Hey all,

I’m currently developing some semi-automatic welding add-in and I have noticed a rather unexpected behavior when I have to find configurations for a number of targets.

The problem is worst when a external manipulator is selected. When no manipulator is selected I can, atleast sometimes, create 10000 targets with a random XYZ position between 0-1 and iterate through them all to find out if there is a valid configuration or not for each of them.

But if I select a manipulator, it can barely do 50 targets. What I experience is that the method that I’m calling returns fine, but when Robot Studio enters its mainloop it get stuck in a wait, in the threading part of mscorlib - see two stack traces below (find by pausing code execution).

mscorlib.dll!System.Threading.Monitor.Wait(object obj, int millisecondsTimeout, bool exitContext) + 0x16 bytes
… mscorlib.dll!System.Threading.Tasks.Task<RobotStudio.Services.RobApi.RobControllerOperatingMode>.GetResultCore(bool waitCompletionNotification) + 0x20 bytes

mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() + 0x5 bytes
[Native to Managed Transition]

And the other:

mscorlib.dll!System.Threading.Monitor.Wait(object obj, int millisecondsTimeout, bool exitContext) + 0x16 bytes

RobotStudio.Services.RobApi.dll!RobotStudio.Services.RobApi.RobControllerConnection.TrySendCommandOnCurrentThread(string cmd, string url, string prop, string args) + 0xd9 bytes
RobotStudio.Services.RobApi.dll!RobotStudio.Services.RobApi.CollectionHelper<RobotStudio.Services.RobApi.RobSymbol>.GetItems.AnonymousMethod__0(System.Threading.Tasks.TaskCompletionSource<RobotStudio.Services.RobApi.RobSymbol> tcs, System.Collections.Generic.List<System.Action> _) + 0xff bytes
RobotStudio.Services.RobApi.dll!RobotStudio.Services.RobApi.TaskUtils.Run<RobotStudio.Services.RobApi.RobSymbol>.AnonymousMethod__0() + 0x8d bytes

mscorlib.dll!System.Threading._ThreadPoolWaitCallback.PerformWaitCallback() + 0x5 bytes
[Native to Managed Transition]

It seems that the virtual controller is not responding and hence Robot Studio just hangs and the only thing to do is to force it to close (stop debugging / terminate process).

I hope a solution can be found - either by you, or corrections to my use of the API.

I have attached a VS2012 project that implements the required methods to test this and I have also attached a pack&Go with a robot and two manipulators.

webwiz/4527/TestProjects.rar

Hi Lars, I have downloaded the project and will take a look at it.

You are writing that “When no manipulator is selected”… do you mean selected like selected in the tree view? In your addin I only found one button, so there is nothing to select there. Right?

OK - if I activate for example STN_1 in your station I can reproduce the problem.
It hangs after the button event handler has returned.
A work item has been created, and a PDD by the support team.

Thanks a lot for looking into it, Niklas :slight_smile: