C271A1 Error during thread

I’m getting the subject error when running a program to tend CNCs. I’ve had it before but fixed it using wait and/or sync() nodes in the thread. This time it’s not working.

I’ve rebooted polyscope and it worked once after that but failed the very next part.

The error:

The original code:
image

Added syncs and waits in all variations I could:
image

I have other programs with the exact same threads and they usually work fine. I’ve had some of these same errors but adding the waits has always fixed it.

Is there something else I should be looking at?

Might need to have sync() outside the if-statement

Basically any time you create a thread you need to end it with a sync() command. This uses up any physical time remaining after the code is complete. Currently if that statement is false it sits there and doesn’t know what to do (at least this is how I see it, it could be trying to run it several hundreds/thousands of times within the controller time step (500Hz or 0.002sec) but again not sure how Polyscope operates)

This is the structure for a thread:

Thread_1
   # Any code
   |
   |_
sync()

Not sure why the sync() isn’t internal to the Thread node but currently you have to add the script yourself (there’s probably a reason they don’t, but I’m learning as I go)

Anyways hope that helps and best of luck!

1 Like

Thanks much. I didn’t know where they sync() was supposed to go. I shut the TP down for a half hour while I did other things and came back and it’s working (without the sync()).

I added it to the end of the thread and will run them like that from now on. Hopefully that takes care of it.

Thanks again for the heads up on where to pup the sync()

FYI for anyone else having this issue:

Started the bots up this morning and keep getting the same alarm.

Turns out my sync() node was in the wrong place per @michael.r.mercer 's post above.

I put it here:
image
Should have been here:
image