Running Example Jog through IDLE


#1

I’m trying to run python scripts to control the Dobot outside of Studios. However, I can’t even get the example jog code to run. When I try I get this error

Traceback (most recent call last):
File “H:/MyDobot/test jog.py”, line 3, in
dType.SetJOGJointParams(api, 150, 150, 150, 150, 150, 150, 150, 150)
NameError: name ‘dType’ is not defined

The example (which does run in Studio)

import math

dType.SetJOGJointParams(api, 150, 150, 150, 150, 150, 150, 150, 150)

while(True):
dType.SetJOGCmd(api, 1, 1, 1)
dType.SetWAITCmd(api, 500, 1)
dType.SetJOGCmd(api, 1, 0, 1)
dType.SetWAITCmd(api, 200, 1)

dType.SetJOGCmd(api, 1, 2, 1)
dType.SetWAITCmd(api, 500, 1)
dType.SetJOGCmd(api, 1, 0, 1)
dType.SetWAITCmd(api, 200, 1)

#2

What is your operating environment and is it configured properly?


#3

I’m running Windows 10 and the latest python and as far as I can tell, everything is configured the way it should be.


#4

You have to import the DobotDtypeDLL.py functions provided in the DemoV2 to your program in order to use them. You can find this file and examples in the official download page of Dobot.


#5

Also, you need to install Python 3.5.0 at 32bit.
That’s the only way it worked for me.