does anybody have a program example that would cycle SW12 off for 10 min for once every day? every 7 days?
Thanks
Here is one way:
Public RTime(9)
' (1) year, (2) month, (3) day of month, (4) hour of day, (5) minutes,
'(6) seconds, (7) microseconds, (8) day of week (1-7; Sunday = 1), (9) day of year.
'Main Program
BeginProg
PortSet (9,1 ) ' turn SW12 on when program is sent to logger
Scan (1,Sec,0,0)
RealTime (RTime())
'To turn SW12 off then on ten minutes later once a day at midnight:
If TimeIntoInterval (0,1440,Min) Then PortSet (9,0 ) ' turn SW12 off
If TimeIntoInterval (10,1440,Min) Then PortSet (9,1 ) ' turn SW12 on
'To turn SW12 off then on ten minutes later once a week (Monday at midnight):
If RTime(8) = 2 Then 'on Monday
If TimeIntoInterval (0,1440,Min) Then PortSet (9,0 ) ' turn SW12 off
If TimeIntoInterval (10,1440,Min) Then PortSet (9,1 ) ' turn SW12 on
EndIf
NextScan
EndProg
* Last updated by: Janet on 5/2/2012 @ 9:04 AM *