Campbell Scientific COM320 Voice Communications Modem User Manual

Page 12

Advertising
background image

COM320 Voice Communications Modem

' CR1000

' BASIC_VOICE_2.CR1

' Program employs VoiceSetup instruction available in OS CR1000.Std.12 and later

' 1st phone number is called if Diff 7 TC temperature > 85F
‘ Program continues to call callback phone number list until someone answers and presses # key
‘ resetting alarm.
' Callback phone numbers are in constants in the SlowSequence at the bottom of the program.

' Key Press Functions:
' # resets alarm condition or toggles port/flag
' 1,2,3,4,5,6,7,8 select certain menu items
' * returns one menu level (returns from subroutine) or disconnects
' 0 is not used in this program
' 9 should be avoided since it will trigger an attempt to connect to a modem

' Timeouts (for key presses and for the total on line time) are constants listed below
' and can be adjusted.

Public Value(3)
Alias Value(1) = BatteryV
Alias Value(2) = PTemp
Alias Value(3) = TCValue_F

Const KeyTimeout = 800

' 8 second timeout waiting for key stroke before hangup

Const SecsOnLine = 360

' 6 minutes On Line Timeout

Const STAR = 42

' The * key (STAR)

Const POUND = 35

' The # key

Const HangupIfKeyTimeout = TRUE ' Will hangup if times out waiting for a key
Const RINGTIME = 20

‘ Maximum time allowed for a phone to be picked up and # pressed


Public mykey As Long

' **** VOICE CODE executed when DL detects COM320 RING or when DialVoice() succeeds ****

Public CallingOut As Boolean

' Detects whether we are calling out or calling in


' STAR (*) key will be used to return from subroutines and to disconnect if not in a subroutine

VoiceSetup (STAR,STAR,0,SecsOnLine,HangupIfKeyTimeout,CallingOut)

VoiceBeg

If CallingOut Then

' We are calling out triggered by DialVoice()

Call

CallOutVoice

Else

Call CallInVoice

' We are calling in

EndIf
EndVoice

6

Advertising