Cannot Create Thread

I’m trying to write a new Program for pick & place. When I add a Thread and try to run the code I get an error popup

I’m only trying to use 1 thread so can’t understand how the message thinks I’m using 50!
If I remove the Thread the program runs Ok.

1 Like

If you don’t mind sharing, what does the program look like. Are you running a check continuously if-statement? Do you have some URscript you are executing?

Thanks for the response.
I’ve found the problem myself.

I had a Script file (Get_Task() used to decide what action to do next) that was returning a value. There was a syntax error on the return command (which Polyscope didn’t notice (and neither did I !!!).

The alarm message I think is misleading although it did identify that it was Get_task() that was causing the problem.
but why that would suggest a problem with the thread is confusing.

If you have any URCaps installed on your robot, some of them might contribute threads to Polyscope. Confusingly, no more than 50 threads can even be declared in a program, even if only 50 intend to run at once. We have had this problem with our URCaps in the past, where we try and contribute more than 50 threads to a program, despite only ever needing to run 1 at once.

Why the syntax error lead to this popup I have no idea!