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.

Powering on Iridium modem every 3 days for 20 minutes with 2 Scan intervals


BDHudson Jul 15, 2012 02:04 AM

First - thanks in advance for any help with this.
I am trying to write code that will power an Iridium data modem through a crydom solid state relay (turned on and off by control port 1 on a CR1000 datalogger) for 20 minutes every 3 days. I have a solution, but wanted to see if there were any better ways to attack this problem.
The trouble is that all the code examples I have seen have used scan intervals that are much less than the time I want the iridium on. (ie they scan every minute, or 30 seconds).
The stations I am running have the main scan interval at 60 minutes. this means that if I include the turn on the iridium command (by turning on the control port) in the main scan loop the if statement that controls it only gets evaluated every hour- so in essence the shortest I can have the Iridium on is 60 minutes.
To deal with this I have used the slow sequence command to set up another scan loop which gets evaluated every 20 minutes. Its still a little clunky, but with this setup I have it turning itself on every every 3 days (every 4320 minutes), and then the scan the condition that turns the iridium on is re-set to 0 (off). Is there a better way to do this? Below is my code.
One solution I am looking into us using the pulsePort command.But is there a practical limit to how long this can be on (ie is 20 minutes too much?)
Thanks,
Ben
'-------------- Declarations -----------
' ----------Variable that can be changed ---------------
Const sensorSampleInt = 60 ' units in minutes right now
Const slowSeqInt = 20 ' units in minutes right now. This also controls how long the modem will be on (i.e. set to 2 min = modem powered for 2 min)
Const iridiumIfTimeoffset = 720 ' units in minutes. 720 moves the modem turn on point to 12 noon instead of midnight
Const iridiumOnTimeInt = 4320 ' At what interval will the iridium be turned on. The duration of the on time is controlled by the slow sequence scan interval
'Define Data Tables
'Main Program
BeginProg
Scan(sensorSampleInt,Min,1,0)
'main scan commands here.
NextScan
SlowSequence
Scan(slowSeqInt,Min,0,0)
PortOn = 0
If TimeIntoInterval(iridiumIfTimeoffset,iridiumOnTimeInt,Min) Then
PortOn=1 'at 3 day (4320 minutes in 3 days)intervals, set PortOn to 1, the next scan (2o min. later, will set this back to zero
PortSet(1,PortOn) 'When PortOn = 1, port will be set high
NextScan
EndProg

* Last updated by: BDHudson on 7/14/2012 @ 8:06 PM *


aps Jul 17, 2012 01:49 PM

Using a slow sequence is the most efficient way of doing what you want in terms of power consumption, if nothing else.


aps Jul 17, 2012 02:00 PM

Continued...

Sitting in a Pulseport will not do this and you cannot stretch the pulse long enough anyway - max is 35000 microsec.

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