Return to KLUBNL.PL main page

rsgb_lf_group
[Top] [All Lists]

Re: LF: Windows software to drive a relay at a given time?

To: [email protected]
Subject: Re: LF: Windows software to drive a relay at a given time?
From: "P. W. Schnoor" <[email protected]>
Date: Wed, 11 Apr 2018 19:03:07 +0200
In-reply-to: <[email protected]>
References: <[email protected]>
Reply-to: [email protected]
Sender: [email protected]
User-agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.7.0
Hi Chris,

On 11.04.2018 12:16, you wrote:
...
Software to close a relay at a given time, perhaps via the serial port?
...

Seven lines of "Python" and a relay circuit connected to com1, RTS-pin:

# import libraries:
import serial # see https://pythonhosted.org/pyserial/
import time   # needed for time delay ("sleep()")

# Create a connection object to com1:
com = serial.Serial('com1', baudrate=9600, bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, timeout=1, xonxoff=0, rtscts=0 )

com.setRTS(True)  # CLICK!

time.sleep(60)    # Wait 60 sec. or whatever

com.setRTS(False) # CLACK!

com.close()
# END

Use the standard system tool "Windows Task Scheduler" to run it at a given time. I did not check it on Windows, but on Linux (device name changed and using cron) it works driving an old rtty-relay ("Kleinpolrelais") from Siemens directly.

Peter, df3lp

<Prev in Thread] Current Thread [Next in Thread>