beautypg.com

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

Page 108

background image

Appendix G. CRBasic Program Library

Public

Temp(2) : Units Temp()

=

DegC

' Temperature in DegC

Public

TempBL(2) : Units TempBL()

=

DegC

' Temperature Baseline in DegC

Public

StrainStdDev(2) : Units StrainStdDev()

=

Microstrain

'StdDev of dynamic strain readings

Public

ZeroMode

'Mode variable for baseline/offset zeroing calibration

'Diagnostic Code flags

Public

ExciteStr(2) : Units ExciteStr()

=

Volts

'Excitation strength on the VW channel in volts

Const

VoltFactor

=

1/42.5

'For converting 0-255 range of excitation into 0 to 6V

Public

LowAmpCount(2)

As Long

Public

HighAmpCount(2)

As Long

Public

LowFreqCount(2)

As Long

Public

HighFreqCount(2)

As Long

Public

ResetCounts

As

Boolean

'Configure the CDM-VW300 device

Dim

Enable(2)

As Long

=

{ 1, 1}

Dim

Max_AMP(2)

=

{ 0.002, 0.002}

Dim

F_Low(2)

=

{ 300, 300}

Dim

F_High(2)

=

{ 6000, 6000}

'Use Hz^2 (1) instead of Hz (0) so we can get to digits

Dim

OutForm(2)

As Long

=

{ 1, 1}

'Use a multiplier of 0.001 to divide by 1000 and get digits, then scale further to get Strain.

Dim

Mult(2)

=

{ 0.001*GageFactor*NomBatchFactor,

0.001*GageFactor*NomBatchFactor}

'Digits (Hz^2/1000) times G times B results in strain

Dim

Off(2)

=

{ 0.0, 0.0}

'Use Steinhart-Hart coefficients To get Thermistor output in DegC

Dim

SteinA(2)

=

{1.4051E-3, 1.4051E-3}

Dim

SteinB(2)

=

{ 2.369E-4, 2.369E-4}

Dim

SteinC(2)

=

{ 1.019E-7, 1.019E-7}

Dim

RFMB(2)

As Long

=

{ 20, 20}

Dim

RFAB(2)

As Long

=

{ 20, 20}

Dim

RFLL(2)

=

{ 400.0, 400.0}

Dim

RFHL(2)

=

{4000.0,4000.0}

Dim

RFHY(2)

=

{ 0.005, 0.005}

Dim

RFOF(2)

As Long

=

{ 100, 100}

CDM_VW300Config

(0,CPI_ADDR,0,Enable(),Max_AMP(),F_Low(),F_High(), _

OutForm(),Mult(),Off(), SteinA(),SteinB(),SteinC(), _

RFMB(),RFAB(),RFLL(),RFHL(),RFHY(),RFOF())

DataTable

(static,true,-1)

Sample

(2,StaticStrain(),IEEE4)

Sample

(2,Temp(),IEEE4)

Sample

(2,StrainStdDev(),IEEE4)

EndTable

DataTable

(slow,true,-1)

DataInterval (0,1,Min,10)

Average

(2,StaticStrain(),IEEE4,False)

Average

(2,Temp(),IEEE4,False)

Average

(2,StrainStdDev(),IEEE4,False)

Average

(2,ExciteStr(),IEEE4,False)

Sample

(2,LowAmpCount(),UINT2)

Sample

(2,HighAmpCount(),UINT2)

Sample

(2,LowFreqCount(),UINT2)

Sample

(2,HighFreqCount(),UINT2)

EndTable

DataTable

(dynamic,true,-1)

Sample

(2,Strain(),IEEE4)

Sample

(2,DCode(),IEEE4)

Sample

(2,ExciteStr(),IEEE4)

EndTable

DataTable(CalHist,NewFieldCal,-1)

SampleFieldCal

EndTable

BeginProg

'50 Hz/20msec scan rate

Scan

(20,msec,500,0)


CDM_VW300Dynamic

(CPI_ADDR,Strain(),DCode())

'Get unshifted strain

G-16