Python connection to MG400


#1

Good day,

I am playing on MG400 using Python. Downloaded ‘Dobot Demo V2.3-en’ (the download name is saying for DOBOT Magician, but this is the only demo I can find).

I am facing error below, tried to solution
Python demo connection provided(restart PC, restart MG400, change COM number etc)

PS C:\Users\patri\Desktop\dobot\Dobot Demo V2.3-en\demo-magician-python-64-master> & ‘C:\Users\patri\AppData\Local\Microsoft\WindowsApps\python3.8.exe’ ‘c:\Users\patri.vscode\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy\adapter/…/…\debugpy\launcher’ ‘56544’ ‘–’ ‘c:\Users\patri\Desktop\dobot\Dobot Demo V2.3-en\demo-magician-python-64-master\DobotControl.py’
您用的dll是64位,为了顺利运行,请保证您的python环境也是64位
python环境是: (‘64bit’, ‘WindowsPE’)
CDobotMgr::getProductName start ctrlType 1 subDevId 0
CDobotMgr::getProductName return deviceName: “” result: 2

Can not found Extcontroller, try to find Magician
CDobotMgr::getProductName start ctrlType 0 subDevId 0
CDobotMgr::getProductName return deviceName: “” result: 2

Can not found Extcontroller and Magician, but connected something! What the hell?
Connect status: DobotConnect_NoError

code:

#Load Dll and get the CDLL object

api = dType.load()

#建立与dobot的连接

#Connect Dobot

state = dType.ConnectDobot(api, “”, 115200)[0]

print(“Connect status:”,CON_STR[state])


#2