A.4.4, Example programs for data callbacks via a cr1000, Appendix a.4.4 – Campbell Scientific COM220 56k Phone Modem User Manual

Page 31

Advertising
background image

Appendix A. Changing COM220 Settings

13: Extended Parameters (P63)

;7-digit phone number

1: 5

Option

2: 5

Option

3: 5

Option

4: 1

Option

5: 2

Option

6: 1

Option

7: 2

Option

8: 13

Option ;13 is the termination character; always place after phone number


End Program

A.4.4 Example Programs for Data Callbacks via a CR1000

Datalogger Router

To do data callbacks via a datalogger router with COM220 and RF401s or

MD485s, they must all be configured to communicate with one another. In

addition, two programs are necessary: one for the datalogger router and one for

the remote datalogger. Below are example programs for a datalogger router

and a remote datalogger. For these examples, the COM220 is configured for

SDC7 and the router datalogger has the following settings (you can enter these

settings via the datalogger keypad or from the LoggerNet status table):

PakBusAddress = 2, IsRouter = 1 or True, and BeaconSDC8 = 30, enabling the

router to discover the remote. The remote datalogger’s PakBusAddress = 1. In

addition, the RF401s or MD485s are set for CSDC8 (see the RF401 or MD485

manual for directions on configuring these devices).

Program for CR1000 Router:

'Router program for data callback via router w/ phone link to LoggerNet
'Phone to MD485 or RF401 w/ DL at Base
'Router PakBus Address = 2, IsRouter = 1, BeaconSDC8 = 30 to discover Remote DL
which has PBA = 1
'Router COM220 = SDC7; Base RF401 CSDC8; Remote RF401 CSDC8.
'LoggerNet PakBusPort has PBA = 4094

' PC-pcMODEM --------COM220sdc7-CR1000(2)-RF401sdc8~~~~~~~~~~~RF401sdc8-CR1000(1)

Public PanelTemperature, BatteryVoltage, DialSuccess
Public Flag(10) AS BOOLEAN

SequentialMode
DataTable (TestA,1,-1)
DataInterval (0,2,Sec,10)
Minimum (1,BatteryVoltage,FP2,0,False)
Sample (1,PanelTemperature,FP2)
EndTable

DialSequence (4094)
StaticRoute(ComSDC8,4094,4094) ' So router discovers LoggerNet server
DialSuccess = DialModem (ComSDC8,9600,"5551212","")
' Param 4 = "" allows CR1000 to accept all possible COM220 responses
' DialSuccess: -1 means successful, 0 means failure.
EndDialSequence (DialSuccess)

BeginProg
Scan (2,Sec,0,0)
PanelTemp (PanelTemperature,250)
Battery (BatteryVoltage)
CallTable TestA
NextScan
EndProg

A-11

Advertising