Hi there!
So I have a welding program from a supplier in the format of .script.
I need to make some manual edits to this script (Which is why I don’t just run the .urp)
I have been trying to set up a way to run this edited .script.
One way I’ve tried to do this is by turning the entire .script into a string and sending it over TCP, but it does not execute. (I might be doing it wrong)
Another thing I’ve tried is to upload the .script the to Polyscope and then create a .urp which calls the .script, but I’m not sure how to implement this correctly
So in essence, I don’t care if the modified .script file is run from inside a .urp file that calls it, or if I somehow send the entire .script over to the robot (UR10e). - I will be very happy as long as the .script is just run somehow.
Looking forward to hearing from you
What happens if you insert just a script node, choose File, and select this script file and then press Play? You get some “function double defined error” or something?
1 Like
That is what I did
And those errors are exactly what I got, but simply deleting all the lines with the prefix “$” seemed to remove the error, but then the code still won’t run. - When I press the play button on the Polyscope nothing happens, it seems as though the program is just empty, or something like that.
So maybe removing those “$” is the issue, or I am somehow using that script node in a wrong way
What do you think?
Most likely the URCAP that’s controlling the welder is writing script in the installation node behind the scenes. So when you put the script file containing all those things in and press Play, The CAP creates all the functions, and then runs your script file, and then gets mad because some of the functions are being defined twice. You should be able to see this with some verbiage in the script file like “start of URCAP installation node” and later an “end of URCAP installation node.” Any functions declared (noted by the keyword “def”) should be deleted from YOUR script file, as these are being re-generated at runtime by the URCAP anyway.
1 Like
Yes, that actually resolved those errors, thank you!
For anyone experiencing errors after applying this first fix:
After modifying the program by removing any function definitions, i got a new set of errors every time a thread was started (Once again a double definition error, suggesting the URCap starts the threads as well). so every time i get an error for a double defined thread i systematically removed them one by one, until I got no more errors.
Then when I ran the script node, I got no errors, but the node didnothing, and simple remained blue, never stopping the program. Suggesting that something got it stuck.
I went in there found an infinite while loop which fixed that problem, but resulted in a new set of “Double Defined Label Errors” I removed any lines with the prefix “$” which resolved that error.
I also tried to remove any code which would be started by the URCap anyway.
All of this in its entirety resulted in the script node being able to run the .script file