Reaching 50 allowed Threads with only one defined

Hej Forum

using URsim in a VirtualBox
version 3.12.0.908886 (nov 15 2019)

I have created a URCap that uses threads for various tasks and somehow I suddenly reached the 50 threads limit in the simulation.
Then I tried to delete all URCap from the simulation and restart the simulation. After this, the program won’t accept any new threads making the error that the 50 thread cap has been reached.

My question, can I somehow clear the unused threads?
and is this only a problem in simulation?

thanks in advanced this forum have helped a lot with other problem I’ve had.

The problem also happens when another type is used ie. UR5 and UR3

Hi,
Please try to uncheck the checkbox “Program Loops Forever” in the Main program and see if it helps.

yeah, it was that.
come to think about it, it make a lot of sense thanks for fast responce

Hi!

I have the same issue. However, I can’t uncheck the “Program Loops Forever” in either the main program nor in the Thread because the main program and the thread are intended to run “infinetly”, that is to say the whole workshift at least. How can I overcome this issue without unchecking the “Program Loops Forever”?

Thanks!

You just need to make sure the creation of the Thread is not in a loop. I typically just declare/start the threads in the “Before Start” sequence, or else just wrap it in an if() that you can block with a boolean.

Set a locking boolean to false on startup
in Main:
if(not blocking_boolean):
set blocking_boolean True
run thread
end

1 Like

Where do you create the Thread in your URCap? And where do you call to run the Thread in your URCap? If it is always supposed to run and never stop then you should do all this once in your Installation Node.

1 Like