Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR1000 SW12


GA Dec 1, 2008 08:41 PM

does anybody have a program example that would cycle SW12 off for 10 min for once every day? every 7 days?

Thanks


jra Dec 2, 2008 01:58 PM

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 *

Log in or register to post/reply in the forum.