I'm using the 16-way SSR to control power to some devices.  I need the outputs to generally be on (connected), and I'm making a power-cycle script to set them off, wait for a bit, set them on again, and exit.
I'm using the Python API, and found that if I use "finalize" when I want to freeze the output state, it seems to do what I want.  It prints an error message on exit, but that seems to only be cosmetic.
So in short if I modify the demo app in this way, it does what I need (with the understanding that the output reset on opening the output is inconsequential for my usecase, even though that might be non-ideal for other usecases):
Code: Select all
# powercycle script
def main():
        digitalOutput0 = DigitalOutput()
        digitalOutput0.openWaitForAttachment(5000)
        # digitalOutput0.setDutyCycle(1)
        digitalOutput0.setState(False)
        # try:
        #         input("Press Enter to Stop\n")
        # except (Exception, KeyboardInterrupt):
        #         pass
        time.sleep(5)
        digitalOutput0.setState(True)
        #digitalOutput0.close()
        digitalOutput0.finalize(0)