2 voice instructions, 1 voicebeg / endvoice, 2 voicespeak – Campbell Scientific COM320 Voice Communications Modem User Manual

Page 20: 3 voicekey

Advertising
background image

COM320 Voice Communications Modem

5.2 Voice Instructions

The Quick Start example voice callback/callin program
“BASIC_VOICE_2.CR1” provides a starting point from which to build the
features you want.

Patterned after the example program in Quick Start, voice instructions can be
combined in a variety of ways to provide phone access to datalogger data and
for control of datalogger flags/output control ports.

5.2.1 VoiceBeg / EndVoice

This instruction pair contains the code executed when the datalogger detects a
RING signal from the COM320 (a call in). It is placed in the declarations
portion of the program before the BeginProg instruction. The EndVoice
instruction hangs up the modem. So, VoiceHangup is not required unless you
want to hang up the modem under certain condition(s) prior to the execution of
the EndVoice instruction.

The VoiceKey instruction is also used to add a delay before the EndVoice
instruction is executed so that the datalogger will not end the VoiceSpeak
command before the spoken message is completed.

5.2.2 VoiceSpeak

The VoiceSpeak() instruction defines the string spoken by the voice modem.
The string is comprised of concatenated words and string variables. To ensure
coded words are valid, CRBasic checks them against the voice.txt file, which
mirrors the word list internal to the COM320. Voice.txt resides in the
“C:\CAMPBELLSCI\LIB\COMPILER” folder. To use VoiceSpeak(), select it
from the instruction list in CRBasic Editor and click Insert. CRBasic Editor
brings up a list of available words. Words can be inserted in any order. Words
are enclosed with quotes and variables are concatenated with words using a
plus sign. For example, "50MS THE BATTERY VOLTAGE IS" + Value(1) +
"VOLTS" is a valid string. The word “50MS” inserts a 50 millisecond pause
during the announcement. 50MS can be inserted multiple times in series.

5.2.3 VoiceKey

The VoiceKey instruction is used to add a delay before the EndVoice
instruction is executed so that the datalogger does not end the VoiceSpeak
command before the announcement is finished.

The VoiceKey instruction’s timeout parameter is used to add a delay (in 0.01
seconds) before EndVoice or Loop is executed. Multiple VoiceKey
instructions placed before an EndVoice or Loop instruction increase the delay.
The VoiceKey timeout provides silent time for a user to respond to the
announced menu; however, the user can respond by pressing a key in the
middle of an announcement.

If doing concurrent communications (via multiple communication peripherals)
with your datalogger it is recommended that the VoiceKey timeout be
extended to over 5 seconds.

VoiceSetup’s UseTimeout parameter determines whether or not the datalogger
will hang up the COM320 after the timeout in the VoiceKey instruction
expires.

14

Advertising