relay control
Posted: Tue Feb 28, 2023 8:16 am
Hello. I'm trying to understand why channel getState() always reports FALSE even if I know (and can verify) that I've ordered a relay port to be closed. I'm using a four port relay board. PhidgetInterfaceKit 0/0/4, 1014_2
Python:
close one of the relays using the command line tools:
Output is always false, no matter what if any of the relay ports are set open or closed via phidutil2:
Python:
Code: Select all
for i in range(count):
ch = DigitalOutput()
ch.setDeviceSerialNumber(576878)
ch.setChannel(i)
ch.openWaitForAttachment(1000)
state = ch.getState()
dutyCycle = ch.getDutyCycle()
ch.close()
print("port ", i, " State: " + str(state), " Duty cycle ", str(dutyCycle))
Code: Select all
/usr/local/bin/phidutil2 -p 1 1
Code: Select all
port 0 State: False Duty cycle 0.0
port 1 State: False Duty cycle 0.0
port 2 State: False Duty cycle 0.0
port 3 State: False Duty cycle 0.0