COM320 Voice Communications Modem
6
3.1 CR1000 Example Program
The BASIC_VOICE_2.CR1 example voice callback/callin program employing
VoiceSetup()
can be downloaded from CSI’s website under
Support/Downloads/Program | Examples, COM310 Examples.
' 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, in seconds, 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
' ***** Subroutines *****
' Called when calling in:
Sub CallInVoice
Do
VoiceSpeak ("CURRENT STATION DATA 50MS 50MS", 0)
VoiceSpeak ("PRESS ONE TO HEAR THE BATTERY VOLTAGE 50MS", 0)
VoiceSpeak ("PRESS TWO TO HEAR THE DATALOGGER TEMPERATURE 50MS", 0)
VoiceSpeak ("PRESS THREE TO HEAR THE T C TEMPERATURE 50MS", 0)
Summary of Contents for COM320
Page 2: ......
Page 6: ......
Page 32: ...COM320 Voice Communications Modem 24 ...
Page 34: ......
Page 40: ...Appendix B Updating and Configuring the COM320 B 6 ...
Page 46: ...Appendix D COM320 Word List D 4 ...
Page 47: ......