'CR1000 'Created by Short Cut (4.3) ' 10/16/2025 - changed on time for modem to 1:55pm-2:15pm AKST, and 3:00-3:15 AKST, increased time allows for initially setup string 'Declare Variables and Units Dim ModSecsWin As Long Public BattV Public PTemp_C Public AT Public SW12State As Boolean Public SetupStr As String * 51 Public configure_modem As Boolean Units BattV=Volts Units PTemp_C=Deg C Units AT=Deg C 'Define Data Tables DataTable(Hourly,True,-1) DataInterval(0,60,Min,10) Sample(1,AT,FP2) Average(1,AT,FP2,False) Sample(1,BattV,FP2) Average(1,BattV,FP2,False) Sample(1,PTemp_C,FP2) Average(1,PTemp_C,FP2,False) EndTable DataTable(Daily,True,-1) DataInterval(0,1440,Min,10) Minimum(1,BattV,FP2,False,False) Average(1,BattV,FP2,False) Average(1,PTemp_C,FP2,False) Average(1,AT,FP2,False) EndTable 'Main Program BeginProg 'Main Scan Scan(60,Sec,1,0) 'Default CR1000 Datalogger Battery Voltage measurement 'BattV' Battery(BattV) 'Default CR1000 Datalogger Wiring Panel Temperature measurement 'PTemp_C' PanelTemp(PTemp_C,_60Hz) '109 Temperature Probe measurement 'AT' Therm109(AT,1,1,1,0,_60Hz,1,0) 'SW12 Timed Control 'Get seconds since 1990 and do a modulo divide by 86400 seconds (24 hours) ModSecsWin=Public.TimeStamp(1,1) MOD 86400 'Turn ON SW12 between 1400 hours and 1415 hours and 1500 and 1515 If (ModSecsWin>=50100 AND ModSecsWin<51300) Then SW12State=True ElseIf (ModSecsWin>=54000 AND ModSecsWin<54900) Then SW12State=True 'Turn OFF SW12 only if time runs out and RS232 is not active ElseIf (ComPortIsActive(ComRS232)=False) Then SW12State=False EndIf 'Always turn OFF SW12 if battery drops below 12.0 volts If BattV<12.0 Then SW12State=False 'Set SW12 to the state of 'SW12State' variable SW12(SW12State) 'Allow the modem 1 minute for warm up before sending settings. Once settings are 'sent to the modem allow another 4 minutes to ensure the modem is registered on 'the network before attempting communications. If IfTime (835,1440,min) Then configure_modem = true If configure_modem = true Then SerialOpen (ComRS232,19200,0,0,2000) Delay (0,1,Sec) 'Send the correct settings SetupStr = "AT&F0 S0=1 &D0 +IPR=6,0 V0 &K0 &W0 &Y0" & CHR(13) & CHR(10) SerialOut (ComRS232,SetupStr,"",0,0) configure_modem = false SerialClose (ComRS232) EndIf 'Call Data Tables and Store Data CallTable Hourly CallTable Daily NextScan EndProg ›