Hi all,
If I want to use the switched 12 v terminal on my CR 800 to switch the power to Raven XT during schedule communication interval, how am I supposed to program my data logger? Or can I just configure by using 'Short Cut'
Thanks for help~~
Take a look at this article:
https://www.campbellsci.com/tips-decisions
Janet
Here is some code that may be of help.
It turns a port on for a specific amount of time at a regular interval. That interval might be 1 minute, 3 hours, or even the whole day.
----------------------------
'SW12V = 9
Const Port = 9
'set port high every OnEvery seconds
Const OnEvery = 3600
'hold port high for OnFor seconds
Const OnFor = 900
'offset cycle OnOffset seconds into OnEvery
Const OnOffset = 0
Public SecIntoDay As Long
Public PortState As Boolean
BeginProg
Scan (1,Sec,0,0)
'seconds into the current day
SecIntoDay = Public.Timestamp(4,1)
If ((SecIntoDay - OnOffset) MOD OnEvery) <= OnFor Then
'time to turn on port
PortState = TRUE 'turn port on
Else
PortState = FALSE 'turn port off
EndIf
PortSet (Port,PortState)
NextScan
EndProg
---------------------------------------
Example:
OnEvery = 3600
OnFor = 900
OnOffset = 60
Every 3600 seconds, the port will be held high for 900 seconds
The time at which the port will be turned on will be offset by 60 seconds
So for example, the port will be held high 12:01:00 to 12:16:00, 13:01:00 to 13:16:00, etc.
Thanks all! They help~~