Hello,
I am a little confused on how callbacks work with LoggerNet and a CR1000. We are trying to have a CR1000 initiate calls using a Global Star satellite modem to a PC with a phone modem (land line) running LoggerNet. We have been able to get LoggerNet to answer a call from the CR1000, but any attempts we make to have LoggerNet communicate with the CR1000 always start with LoggerNet trying to call out which kills the connection.
I know that data retrieval is normally initiated from LoggerNet (usually on a schedule), but is it possible to have the CR1000 initiate the data transfer?
Thanks,
Bruce Andrews
Hello,
I think I just answered my own question. We found the "Modem Callback" function in CR Basic. This does just what we want to do.
Bruce Andrews
Great that you found ModemCallback
This is another alternative, just for FYI.
ConstTable
Const LN_PBA = 4094 'PB address of LN
Const LN_PH_NO = "15551234567" 'phone number to call
EndConstTable
Const COMPORT = ComSDC7 'Comport modem is connected to
Const BAUDRATE = 115200 'Modem baud rate
Public DialSuccess
Public Result
'specialized sub routine that will be
'executed anytime this logger tries to
'communicate with LN_PBA
DialSequence (LN_PBA)
DialSuccess = DialModem (COMPORT,BAUDRATE,LN_PH_NO," ")
If DialSuccess Then
'say hello for good measure
Broadcast (COMPORT,14)
EndIf
EndDialSequence (DialSuccess)
Public PTemp, batt_volt
DataTable (Test,1,1000)
DataInterval (0,15,Sec,10)
Minimum (1,batt_volt,FP2,0,False)
Sample (1,PTemp,FP2)
EndTable
BeginProg
Scan (1,Sec,0,0)
PanelTemp (PTemp,250)
Battery (batt_volt)
CallTable Test
NextScan
SlowSequence
Scan (300,Sec,0,0)
'trigger LN to perform a "scheduled" like collection
SendVariables (Result,COMPORT,0,LN_PBA,0000,500,"Public","CallBack",batt_volt,1)
NextScan
EndSequence
EndProg