Issues with 2A DC Motor(DCC1001_0)

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

Issues with 2A DC Motor(DCC1001_0)

Postby MeijinGandalf » Thu Aug 02, 2018 8:29 am

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: 260
Joined: Thu Nov 19, 2009 4:41 pm
Contact:

Re: Issues with 2A DC Motor(DCC1001_0)

Postby fraser » Thu Aug 02, 2018 10:10 am

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: 5
Joined: Thu Aug 02, 2018 8:23 am
Contact:

Re: Issues with 2A DC Motor(DCC1001_0)

Postby MeijinGandalf » Wed Aug 15, 2018 4:21 pm

Ah ok thanks for the help.


Return to “General”

Who is online

Users browsing this forum: No registered users and 1 guest