Issues with 2A DC Motor(DCC1001_0)

Comments & issues
Post Reply
MeijinGandalf
Phidgetsian
Posts: 8
Joined: Thu Aug 02, 2018 8:23 am
Contact:

Issues with 2A DC Motor(DCC1001_0)

Post 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?
fraser
Engineering
Posts: 138
Joined: Thu Nov 19, 2009 4:41 pm
Contact:

Re: Issues with 2A DC Motor(DCC1001_0)

Post 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.
MeijinGandalf
Phidgetsian
Posts: 8
Joined: Thu Aug 02, 2018 8:23 am
Contact:

Re: Issues with 2A DC Motor(DCC1001_0)

Post by MeijinGandalf »

Ah ok thanks for the help.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests