2 program example 2, Program example 2 – Campbell Scientific 9522B Iridium Satellite Modem and COM9522B Interface Modem User Manual

Page 28

Advertising
background image

9522B Iridium Satellite Modem and COM9522B Interface Modem

6.2 Program Example 2

In example 2, the station is a solar powered site where power management is a

concern. Modem power is controlled by the COM9522B via control port 1.

During this time, the modem is sent its configuration via the CS I/O port and

the remainder of the time is used for actual communications.

For details on programming for the CR10X, contact Campbell Scientific.

Please note that the interface between the CR10X and the COM9522B requires

the use of SC932A CS I/O to RS-232 DCE interface.

'CR1000 Series Datalogger

'Declare Public Variables
'Variables for Iridium Configuration
Public SetupStr As String * 51
Public configure_modem As Boolean

'Main Program
BeginProg

'Ensure the control port used to trigger power to the modem is set as an output.
'In this example control port 1 is used to turn power on/off for the modem.
PortSet (1,1)
PortSet (1,0)

Scan (5,Sec,3,0)

'Activate Iridium Modems at Noon & Midnight Daily for 15 minutes each time.
'Allow modem warmup time & check settings (5 minutes) & data transmissions (10 minutes)
' *** Use intervals that are applicable for your application ***

If TimeIntoInterval (715,720,Min) Then PortSet (1,1)
If TimeIntoInterval (10,720,Min) Then PortSet (1,0)

'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 (716,720,min) Then configure_modem = true

If configure_modem = true Then
SerialOpen (ComME,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 (ComME,SetupStr,"",0,0)
configure_modem = false
SerialClose (ComME)
EndIf

NextScan
EndProg

20

Advertising