RoboDK Forum
program.setSpeed() API instruction crashes RoboDK可打印版本

+- RoboDK Forum (//www.sinclairbody.com/forum)
+-- Forum: RoboDK (EN) (//www.sinclairbody.com/forum/Forum-RoboDK-EN)
+--- Forum: RoboDK API (//www.sinclairbody.com/forum/Forum-RoboDK-API)
+--- Thread: program.setSpeed() API instruction crashes RoboDK (/Thread-program-setSpeed-API-instruction-crashes-RoboDK)



program.setSpeed() API instruction crashes RoboDK-halmusaibeli-06-09-2022

Hi Everyone,

I am using the Python API and when adding a speed instruction to the program the window will still pop up although it is disabled as in

Code:
program.setSpeed(value, False)

Then RoboDK can not handle it anymore, and it crashes.
Note, I am generating robot instructions from a CSV file using a for loop, which has about 16k points.
Any help is appreciated.

Regards,
Hamdan


RE: program.setSpeed() API instruction crashes RoboDK-halmusaibeli-06-10-2022

So I solved the problem.


The issue was with the speed value, it was negative which is incorrect. But It would be better if the API would check the value first before it sends it to RoboDK, and throw an error in case of an unexpected value.

Regards,
Hamdan


RE: program.setSpeed() API instruction crashes RoboDK-Albert-06-13-2022

Setting the speed or the acceleration to a negative value will ignore the change of speed. Also, this function was not made to work with booleans but with numbers.