CS-GSM/GPRS Digital Transceiver Kits (including the COM110 modem)
'Main Program
BeginProg
'Normal measurements in the main scan here
Scan (1,Sec,0,0)
PanelTemp (PTemp,250)
Battery (Batt_volt)
'......etc
NextScan
'-------------------------------------------------------------------
'Modem control slow sequence - can be cut and paste as self-contained
'Set this constant to match the port the modem is connected to
Const Modemport=COMME
Const Modembaud = 9600 'Change to match modem baud rate
SlowSequence
'Run once a minute so can have one min resolution of timing
Scan (1,Min,3,0)
'Every hour, in this example, turn on the modem
If TimeIntoInterval (0,60,Min) Then
'Set port 1 to 1 (ON) (use writeio as in slowsequence)
WriteIO (&B00000001,1)
Delay(1,2,sec) 'Allow 2 seconds for the modem to power on
SerialOpen (Modemport,modembaud,0,0,100)
'Send the command to unlock the pin code (PIN=601141 in this case)
'Allow one retry
SerialOut (Modemport,"AT+CPIN=601141"+CHR(13),"OK"+CHR(13),1,100)
SerialClose(Modemport)
EndIf
'10 minutes later turn the modem off
If TimeIntoInterval (10,60,Min) Then
SerialOpen (Modemport,modembaud,0,0,100)
'Send the command to log off the network and shutdown cleanly
SerialOut (Modemport,"AT+CFUN=0"+CHR(13),"OK"+CHR(13),1,300)
SerialClose(Modemport)
'Set port 1 to 0 (LOW) (use writeio as in slowsequence)
Delay(1,2,sec) 'Allow 2 seconds for the modem to shutdown
WriteIO (&B00000001,0)
EndIf
NextScan
EndProg
A-2