How to use the command Function "SetDO(api, DOMap) and GetDO(api)" on DobotSDK?


#1

I tried the SetDo(api,DOMap) command function, I want to know how to configure DOMap to control Digital output port on MG400. Which is currently unable to control.

##################

def SetDO(api, DOMap): """
result = c_int(0)
DOParam = IO()
DOParam.enable = True
for i in range(0, 64):
DOParam.value[i] = DOMap[i+1]
result = api.SetDO(byref(DOParam))
return result

def GetDO(api):
result = c_int(0)
DOParam = IO()
result = api.GetDO(byref(DOParam))
DOMap = dict()
for i in range(0, 64):
DOMap[i+1] = DOParam.value[i]
return [
result,
DOMap
]
#####################

Thank you.


#2


#3

I try to set a value like this, but it has no effect - is there something wrong?
image