beautypg.com

1 cr9000(x) – Campbell Scientific 4WFB120, 4WFB350, 4WFB1K 4-Wire Full Bridge Terminal Input Module User Manual

Page 18

background image

4WFB120, 4WFB350, 4WFB1K 4 Wire Full Bridge Terminal Input Modules

5.2.1 CR9000(X)

This example program is slightly different in operation than the examples for
the other dataloggers. Data are only output to data table STRAINS when the
user sets Flag(1). Every measurement is output (rather than averages like in
the other examples) while Flag(1) is high.

'

Program name: STRAIN.DLD


Public Count, ZStrain, StMeas, Strain, Flag(8)

'Declare all variables as public


'Data Table STRAINS samples every measurement when user Sets Flag(1) High

DataTable(STRAINS,Flag(1),-1)
DataInterval(0,0,0,100)

'Interval = Scan, 100 lapses

Sample (1,Strain,Ieee4)

EndTable

'DataTable ZERO_1 stores the "zero" measurements

DataTable(ZERO_1,Count>99,100)

'Trigger on Count 100

Average(1,ZStrain,IEEE4,0)

EndTable

'Subroutine to measure Zero, Called when user sets Flag(2)low

Sub Zero

Count = 0

'Reset Count

Scan(10,mSec,0,100)

'Scan 100 times

BrFull(ZStrain,1,mV50,5,1,6,7,1,5000,1,0,0,100,1,0)

Count = Count + 1

'Increment Counter used By DataTable

CallTable

ZERO_1

'Zero_1 outputs on last scan (Count=100)

Next

Scan

ZStrain = ZERO_1.ZStrain_Avg(1,1)

'Set ZStrain = averaged value

Flag(1) = True

End Sub


BeginProg
Scan(10,mSec,0,0)

'Scan 10(mSecs)

If Not Flag(2) Then Zero

BrFull(StMeas,1,mV50,5,1,6,7,1,5000,1,0,0,100,1,0)
StrainCalc(Strain,1,StMeas,ZStrain,-1,2,0)
CallTable

STRAINS

'Strains outputs only when Flag(1)=True

Next

Scan

EndProg

14