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.

Using callbacks


bandrews Oct 16, 2012 12:20 PM

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


bandrews Oct 16, 2012 12:56 PM

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


Sam Oct 19, 2012 01:29 AM

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

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