Campbell Scientific COM310 Voice Communications Modem User Manual
Page 14

COM310 Voice Communications Modem
' Monitors a value
Sub SubKey1
Do
VoiceSpeak ("50MS PRESS SENSOR NUMBER 50MS PRESS STAR TO RETURN", 0)
mykey = VoiceKey (KeyTimeout)
If mykey = 1 Then VoiceSpeak ("50MS THE BATTERY VOLTAGE IS" + Value(1) + "VOLTS", 1)
If (mykey = 2) Then VoiceSpeak ("50MS THE REFERENCE IS" + Value(2) + "DEGREES", 1)
If (mykey = 3) Then VoiceSpeak ("50MS THE T C IS" + Value(3) + "DEGREES", 1)
Loop
'
Sensor
value
loop
EndSub
' Read a port and possibly toggle
Sub SubKey2
Do ' Until * or timeout
Dim keybit,port As Long,state
VoiceSpeak("50MS PRESS PORT NUMBER 50MS PRESS STAR TO RETURN", 0)
port
=
VoiceKey(keyTimeout)
If (port > 0) AND (port <= 8) Then
keybit = 2^(port-1) ' Bit 0..7 is set in keybit. Keybit = 2^(port-1).
Do
ReadIO(state,
&b11111111)
VoiceSpeak("50MS C" + port + "IS",0)
If
state
AND
keybit
Then
VoiceSpeak("ON",0)
Else
VoiceSpeak("OFF",0)
EndIf
VoiceSpeak("50MS
PRESS
POUND
TO TOGGLE 50MS PRESS STAR TO RETURN", 0)
If
VoiceKey(KeyTimeout) = POUND Then
ReadIO
(state,&b11111111)
If
state
AND
keybit
Then
state
=
state
AND
(NOT
keybit)
Else
state
=
state
OR
keybit
EndIf
WriteIO(&b11111111,state) ' Toggle control port
EndIf
Loop
EndIf
Loop
EndSub
‘ Read a flag and possibly toggle
Sub SubKey3
Const NUMBERFLAGS = 8
Public
Flags(NUMBERFLAGS)
Do ' Until * or timeout
VoiceSpeak("50MS PRESS FLAG NUMBER 50MS PRESS STAR TO RETURN", 0)
mykey
=
VoiceKey(keyTimeout)
If (mykey > 0) AND (mykey <= NUMBERFLAGS) Then
Do
VoiceSpeak("50MS FLAG" + mykey + "IS",0)
8