beautypg.com

Appendix g. crbasic program library, G-22 – Campbell Scientific CDM-VW300 Series Dynamic Vibrating-Wire Analyzer System User Manual

Page 114

background image

Appendix G. CRBasic Program Library

DataInterval

(0,1,Min,10)

'Using TableFile, write the 1 minute averages out each

'15 minutes to a file on the CRD (Compact Flash) device

TableFile

("CRD:"&Status.StationName(1,1)&".TFStatic", _

64,-1,0,15,Min,NewStaticFileStored,LastStaticFileName)

Average

(2,StaticStrain(),IEEE4,False)

Average

(2,Temp(),IEEE4,False)

Average

(2,StrainStdDev(),IEEE4,False)

EndTable

DataTable

(dynamic,true,-1)

'Using DataEvent, only store data in this table when

'the Microstrain reading is greater than 200 on either channel

DataEvent (100,(Strain(1) > 200) OR (Strain(2) > 200),1,100)

'Using TableFile, write out the 50Hz data to the CRD (Compact

'flash) into a new file whenever 600 data records have been captured

TableFile ("CRD:"&Status.StationName(1,1)&".TFDynamic", _

64,-1,600,0,Sec,NewDynFileStored,LastDynFileName)

Sample

(2,Strain(),IEEE4)

Sample

(2,DCode(),IEEE4)

EndTable

DataTable(CalHist,NewFieldCal,-1)
CardOut (0 ,2000)

SampleFieldCal

EndTable

BeginProg

'50 Hz/20msec scan rate

Scan

(20,msec,500,0)

CDM_VW300Dynamic

(CPI_ADDR,Strain(),DCode())

'Get unshifted strain

'Now shift the given Strain using the Baseline/Offset value

Strain(1)

=

Strain(1) + StrainBL(1) : Strain(2)

=

Strain(2) + StrainBL(2)

'Zeroing calibration for Geokon 4000 Vibrating Wire Strain Gage

'Strain offset and Temperature baseline readings

FieldCal(0,Strain(),2,0,StrainBL(),ZeroMode,0,1,100)

'Calibrate for 2 seconds

FieldCal(4,Temp(),2,0,TempBL(),ZeroMode,0,1,100)

CallTable

dynamic

CallTable

CalHist

If TimeIntoInterval

(0,1,Sec) Then

CDM_VW300Static

(CPI_ADDR,StaticStrain(),Temp(),StrainStdDev())

'Obtain unshifted static

'

strain

'Calculate static digits reading (for troubleshooting)

StaticDigits(1)

=

StaticStrain(1)/GageFactor/NomBatchFactor

StaticDigits(2)

=

StaticStrain(2)/GageFactor/NomBatchFactor

'Now shift the given StaticStrain using the Offset/Baseline reading to obtain

'

Final/adjusted StaticStrain

StaticStrain(1)

=

StaticStrain(1) + StrainBL(1) : StaticStrain(2)

=

StaticStrain(2) + _

StrainBL(2)

'Calculate static frequency from static digits (for troubleshooting)

StaticFreq(1)

=

SQR(StaticDigits(1)*1000) : StaticFreq(2)

=

SQR(StaticDigits(2)*1000)

CallTable

static

EndIf

NextScan

EndProg

G-22