Hi. I cant get this code to work. Anyone got any ideas?
If I move the statement robot.callSubRoutine(“change_base_start”)
to another place in the script it runs but within the function test it does not.
This is the error
File “C:\Program Files\Visual Components\Visual Components Professional 4.1\Python\Commands\vcHelpers\Robot2.py”, line 888, in callSubRoutine if self.RecordRSL: ReferenceError: You cannot suspend script in this scope.
So is seems after further testing the python script with call a subroutine from within a function. It wont work if I am setting a variable from a property to call the function.
So the part which doesn’t work is setting the variable from a property drop down box on the robot model.
Check the API reference for vcExecutor in 4.1. I think you are now able to call a subroutine and give an optional argument to not suspend the script, i.e. don’t wait for the subroutine to finish and continue the execution of script.
Use caution though since you do not want to interrupt the executor when a new call is made before the end of the previous one.
If you are able to, check line 888 in vcHelpers.Robot2 source code to see why the error is given.