VoiceBeg, EndVoice
The VoiceBeg/EndVoice instructions are used to indicate the code that should be executed when the datalogger detects a ring from a voice modem.
Syntax
VoiceBeg
voice code to be executed
EndVoice

In the following program, the code enclosed in the VoiceBeg/EndVoice instructions will be performed when a ring is detected from a voice modem. The datalogger will report the temperature and prompt the user to press the asterisk to end the call. The two messages will be repeated until the datalogger receives the asterisk, a Counter is incremented to 60, or the timeout period expires (2 minutes).
'Declare Variables
Public PTemp, TCTemp, Counter
VoiceBeg
Counter=0
Do
Counter=Counter + 1
VoiceSpeak ("THE TEMPERATURE IS" + TCTemp + "DEGREES", 2)
VoiceSpeak ("PRESS STAR TO DISCONNECT", 2)
'42 is the ASCII code for *
Loop Until VoiceKey(12000)=42 or Counter=60
EndVoice
BeginProg
Scan (1,Sec,3,0)
PanelTemp (PTemp,15000)
TCDiff (TCTemp,1,mv200C,U1,TypeT,PTemp,True ,0,15000,1.0,0)
NextScan
EndProg
Remarks
The VoiceBeg/EndVoice code is placed in the declarations portion of the program (prior to the BeginProg/EndProg code). The two instructions enclose the code that should be run when a ring is detected from a voice modem.
The EndVoice instruction hangs up the modem; therefore, VoiceHangup is not required unless you want to hang up the modem under some condition prior to the execution of the EndVoice instruction.
NOTE: When creating code for voice modems, the VoiceKey instruction should be used to add a delay before the EndVoice instruction is executed. Otherwise, the datalogger will end the VoiceSpeak command before the spoken message is completed.