Page 1 of 1

Issues with 2A DC Motor(DCC1001_0)

Posted: Thu Aug 02, 2018 8:29 am
by MeijinGandalf
The first issue is not a big deal. In the Phidget control panel it shows up as a 3.5A DC Motor Phidget.

The second issue I am having is trying to attach to it in python. This code tells me I have and invalid argument when I try to attach.

Code: Select all

import sys
import time 
from Phidget22.Devices.DCMotor import *
from Phidget22.PhidgetException import *
from Phidget22.Phidget import *
from Phidget22.Net import *

def DisplayError(e):
    sys.stderr.write("Desc: " + e.details + "\n")

ch = DCMotor()
ch.setIsHubPortDevice(True)
ch.setHubPort(4)

try:
    ch.openWaitForAttachment(5000)
    print("Attached!")
except PhidgetException as e:
    DisplayError(e)
    print("Failed to attach")
When I take out the line

Code: Select all

ch.setIsHubPortDevice(True)
it attaches just fine. Do you know what the issue could be?

Re: Issues with 2A DC Motor(DCC1001_0)

Posted: Thu Aug 02, 2018 10:10 am
by fraser
Thank you for identifying the naming error, will fix that.

as for your other problem,
ch.setIsHubPortDevice(True)
will define a device to use the Hub's internal channels, which are only VoltageInput, VoltageRatioInput, DigitalInput, DigitalOutput.
Using any external VINT device (such as the DCC1001) you will want to leave setIsHubPortDevice to the default of False.

Re: Issues with 2A DC Motor(DCC1001_0)

Posted: Wed Aug 15, 2018 4:21 pm
by MeijinGandalf
Ah ok thanks for the help.