Simple Timer-Based Relay Control
Ta treść nie jest jeszcze dostępna w Twoim języku.
This program example switches the EM-486’s relay on/off depending on time of day. At the specified times of the day it switches the relay OFF and ON. Required condition is that OFF-time should be before (less than) ON-time.
The program is controlled through Overvis using registers on EM-486 device.
| Address | Description |
|---|---|
| 5250 | OFF time of day in seconds (e.g. 12:34 is 12×3600+34×60=45240). |
| 5251 | ON time of day in seconds. |
!META* PROTOCOLVERSION 9
!PARAMS# Current time of day in seconds (EM-486 register)0 * INT32 H 230# Setting: Time to turn relay OFF, in seconds1 * INT32 H 5500# Setting: Time to turn relay ON, in seconds2 * INT32 H 5502# EM-486 relay 1 state3 * UINT16 H 160
!VARS# Current time of day in seconds0 PARAMVAL P0# Time to turn relay OFF, in seconds1 PARAMVAL P1# Time to turn relay ON, in seconds2 PARAMVAL P2# EM-486 relay 1 state3 PARAMVAL P3
!CONDS# Time of day has already reached switching off time today0 VARGEVAR V0 V1# Time of day hasn't yet reached switching on time today1 VARLSVAR V0 V2# Relay 2 is switched on2 VAREQVAL V3 1# Relay 2 is switched off3 VAREQVAL V3 0# It's time to switch the relay OFF4 AND C0 C1# It's time to switch the relay ON5 NOT C4# Relay should be switched ON6 AND C3 C5# Relay should be switched OFF7 AND C2 C4
!ACTS0 RELAYON 1 11 RELAYOFF 1 1
!REACTS* C6 ACT A0* C7 ACT A1
# END.This program can be modified to control the OB-215 relay with EM-486. In that case, parameter P3 should be changed to the relay register of OB-215 and ON/OFF actions (section !ACTS) should be changed to the OB-215 control register command. See Astronomical Timer example for reference.