power plug (digital output) not turning off

Comments & issues
Post Reply
johnsayeau
Fresh meat
Posts: 3
Joined: Tue Apr 16, 2019 8:37 pm
Contact:

power plug (digital output) not turning off

Post by johnsayeau »

Hello,

I have a simple script that I am trying to use to power a device on and off again. I am using a vint hub0001_0 and a psu 1000_0 plug

I am sure this used to work but now it supplies power to the device when I do “p.setDutyCycle(1)” or “p.setState(True)” but when I set the duty cycle to 0 or the state to False power is still supplied to the device through the plug. This is on a Mac . The same thing occurs when I try using the phidgets control panel.

Here is the script:

from time import sleep, time
from Phidget22.Devices.DigitalOutput import *

def init_power_plug():
digitalOutput0 = DigitalOutput()
digitalOutput0.setIsHubPortDevice(True)
digitalOutput0.setHubPort(0)
digitalOutput0.openWaitForAttachment(5000)
#digitalOutput0.setDutyCycle(1)
return digitalOutput0

p = init_power_plug()
p.setDutyCycle(1.0)
sleep(1)
p.setDutyCycle(0.0)

Thanks, John.
User avatar
Patrick
Lead Developer
Posts: 616
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: power plug (digital output) not turning off

Post by Patrick »

Will it switch off from the Phidget control panel? Does it switch off when you unplug it?
Post Reply

Who is online

Users browsing this forum: No registered users and 53 guests