
Interfacing the MICROCOM DESIGN GTX Modulator to the Campbell Scientific CR1000 Data Logger PRELIMINARY
Units Batt_Volt=Volts
'
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Constant Declarations'''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Const DebugOnOff = 1
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Alias Declarations'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Alias myTime(1) = Year 'assign the alias Year to rTime(1)
Alias myTime(2) = Month 'assign the alias Month to rTime(2)
Alias myTime(3) = Day 'assign the alias Day to rTime(3)
Alias myTime(4) = Hours 'assign the alias Hour to rTime(4)
Alias myTime(5) = Mins 'assign the alias Minute to rTime(5)
Alias myTime(6) = Secs 'assign the alias Second to rTime(6)
Alias myTime(7) = uSecs 'assign the alias uSecond to rTime(7)
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Define Data Tables'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Test Data Table
DataTable (TempTbl,1,-1)
DataInterval (0,10,Sec,10)
Minimum (1,batt_volt,FP2,0,False)
Sample (1,PTemp,FP2)
EndTable
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'Define Subroutines''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Sub Initialize()
' Use Com1 as an ECHO output port to viwe on Com1
SerialOpen (Com1,9600,0,0,10000)
' Setup Com4 serial port to GTX
SerialOpen (Com4,9600,0,0,10000)
CR=CHR(13)
LF=CHR(10)
CRLF=CHR(13)+CHR(10)
PROMPT= ">"
LINE="_____________________"
Mess1="CR1000 TO Com4->"
Mess2="Com4 TO CR1000->"
EndSub
'''''''''''''''''''''''''''''''''
' Get the Microcom GTX Time
'''''''''''''''''''''''''''''''''
Sub GetGTXTime()
' Request Time from GTX
SerialOut(Com4,"Time?","",0,100)
SerialOut (Com4, CRLF,"",0,100)
' Echo stuff to Debug Terminal
If DebugOnOff = 1 Then
SerialOut(Com1,Mess1,"",0,100)
SerialOut(Com1,"Time?","",0,100)
SerialOut (Com1, CRLF,"",0,100)
EndIf
' Get GTX Responce
SerialIn (InString,Com4,100,10,100)
' Echo stuff to Debug Terminal
If DebugOnOff = 1 Then
© 2005 Microcom Design Inc. All rights reserved voice: 401.771.1070 Fax:410.771.0018
uAPP222 (v1.0) July 12, 2005 http://www.microcomdesign.com 10
Komentarze do niniejszej Instrukcji