CRBasic Example 1: Using GetDataRecord() to extract data from a CRVW3
DataTable
(VW_Data,1,-1)
DataInterval
(0,5,Sec,10)
Sample
(1,Batt_Volt,IEEE4)
Sample
(1,CPU_Temp,IEEE4)
Sample
(1,Chan1_Freq,IEEE4)
Sample
(1,Chan1_Amp,IEEE4)
Sample
(1,Chan1_SigNoisR,IEEE4)
Sample
(1,Chan1_NoisFreq,IEEE4)
Sample
(1,Chan1_DecayRat,IEEE4)
Sample
(1,Chan1_Therm,IEEE4)
Sample
(1,Chan1_Temp,IEEE4)
Sample
(1,Chan1_Digits,IEEE4)
Sample
(1,Chan1_EngOut,IEEE4)
EndTable
Public
CalTime(2) As Long
Public
FreqBL_Chan1
Public
TempBL_Chan1
Public
PressureBL_Chan1
DataTable
(CalHist,1,-1)
Sample
(1,CalTime,Nsec)
Sample
(1,FreqBL_Chan1,IEEE4)
Sample
(1,TempBL_Chan1,IEEE4)
Sample
(1,PressureBL_Chan1,IEEE4)
EndTable
'End of declarations extracted from the CRVW3 terminal mode
'Main Program running GetDataRecord instructions every 5 seconds
BeginProg
Scan
(5,Sec,0,0)
'adding &H8000 to the remote table number is required
'to avoid a -7 table signature mismatch code (returned to GDRResult1/2)
'See the GetDataRecord CRBasic help topic for more details.
'The PakBus address of the CRVW3 is "4", the PakBus neighbor to route
'through is "2"
'The radio is connected to the CS I/O SDC7 port+channel
'Only the most recent record is retrieved and placed into the table
'(MaxRecords=1)
' Use MaxRecords > N to get the most recent N records.For example,
to get the 5 most recent records, set MaxRecords to 5.
GetDataRecord
(GDRResult1,ComSDC7,2,4,0000,0,2,1+&H8000,VW_Data,1)
GetDataRecord
(GDRResult2,ComSDC7,2,4,0000,0,2,2+&H8000,CalHist,1)
NextScan
EndProg
CRVW3 3-Channel Vibrating-Wire Data Logger
80