Campbell Scientific AVW200 AVW200-series Vibrating Wire Interfaces - Page 99

H.2 Datalogger-Controlled Multiplexer

Page 99 highlights

Appendix H. Additional Programming Examples H.2 Datalogger-Controlled Multiplexer ' 'This example demonstrates how to program a CR1000 to collect measurements from sensors 'attached to four AM16/32 multiplexers. The four multiplexers are controlled directly 'by the data logger, not through the AVW200 as in other examples contained in this 'manual. Displacement is calculated from the measured frequencies by applying the 'Polynomial Gage Factors contained in each sensors' calibration report. Only the 'resistance from each thermistor is measured. Temp is calculated by applying the 'resistance to a known equation which converts resistance to temp. Temperature 'correction is not shown in this example. In this example 16 'VW displacement sensors with thermistors are attached to both the first and second 'multiplexers, while only 9 similar sensors are attached to the third multiplexer. '32 VW displacement sensors with no thermistors are attached to the fourth multiplexer. ' SequentialMode Public batt_volt Public Mux(6) Public VWResults Public Temp1(16),Temp2(16),Temp3(12) Public Amp1(16),Amp2(16),Amp3(12),Amp4(32) Public VWfreq1(16),VWfreq2(16), VWFreq3(9),VWFreq4(32) Public Sig2Noise1(16),Sig2Noise2(16),Sig2Noise3(12),Sig2Noise4(32) Public DecayRatio1(16),DecayRatio2(16),DecayRatio3(9),DecayRatio4(32) Public FreqOfNoise1(16),FreqOfNoise2(16),FreqOfNoise3(12),FreqOfNoise4(32) Public Displacement1(16),Displacement2(16), Displacement3(9),Displacement4(32) Dim i Dim j Dim Digits Dim Coef1(48) Dim Coef2(48) Dim Coef3(27) Dim Coef4(96) Const A=.0014051 'Coefficients for Steinhart-Hart equation Const B=.0002369 'used to convert resistance to Temp Const C=.0000001019 DataTable (MuxExample,1,-1) DataInterval (0,15,Min,10) Minimum (1,batt_volt,FP2,0,False) Sample (16,Displacement1(),FP2) Sample (16,VWfreq1(),FP2) Sample (16,Temp1(),FP2) Sample (16,Amp1(),FP2) Sample (16,Sig2Noise1(),FP2) Sample (16,FreqOfNoise1(),FP2) Sample (16,DecayRatio1(),FP2) Sample (16,Displacement2(),FP2) Sample (16,VWfreq2(),FP2) Sample (16,Temp2(),FP2) Sample (16,Amp2(),FP2) H-7

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112

Appendix H.
Additional Programming Examples
H.2 Datalogger-Controlled Multiplexer
'
'This example demonstrates how to program a CR1000 to collect measurements from sensors
'attached to four AM16/32 multiplexers.
The four multiplexers are controlled directly
'by the data logger, not through the AVW200 as in other examples contained in this
'manual. Displacement is calculated from the measured frequencies by applying the
'Polynomial Gage Factors contained in each sensors' calibration report.
Only the
'resistance from each thermistor is measured.
Temp is calculated by applying the
'resistance to a known equation which converts resistance to temp. Temperature
'correction is not shown in this example.
In this example 16
'VW displacement sensors with thermistors are attached to both the first and second
'multiplexers, while only 9 similar sensors are attached to the third multiplexer.
'32 VW displacement sensors with no thermistors are attached to the fourth multiplexer.
'
SequentialMode
Public batt_volt
Public Mux(6)
Public VWResults
Public Temp1(16),Temp2(16),Temp3(12)
Public Amp1(16),Amp2(16),Amp3(12),Amp4(32)
Public VWfreq1(16),VWfreq2(16), VWFreq3(9),VWFreq4(32)
Public Sig2Noise1(16),Sig2Noise2(16),Sig2Noise3(12),Sig2Noise4(32)
Public DecayRatio1(16),DecayRatio2(16),DecayRatio3(9),DecayRatio4(32)
Public FreqOfNoise1(16),FreqOfNoise2(16),FreqOfNoise3(12),FreqOfNoise4(32)
Public Displacement1(16),Displacement2(16), Displacement3(9),Displacement4(32)
Dim i
Dim j
Dim Digits
Dim Coef1(48)
Dim Coef2(48)
Dim Coef3(27)
Dim Coef4(96)
Const A=.0014051 'Coefficients for Steinhart-Hart equation
Const B=.0002369 'used to convert resistance to Temp
Const C=.0000001019
DataTable (MuxExample,1,-1)
DataInterval (0,15,Min,10)
Minimum (1,batt_volt,FP2,0,False)
Sample (16,Displacement1(),FP2)
Sample (16,VWfreq1(),FP2)
Sample (16,Temp1(),FP2)
Sample (16,Amp1(),FP2)
Sample (16,Sig2Noise1(),FP2)
Sample (16,FreqOfNoise1(),FP2)
Sample (16,DecayRatio1(),FP2)
Sample (16,Displacement2(),FP2)
Sample (16,VWfreq2(),FP2)
Sample (16,Temp2(),FP2)
Sample (16,Amp2(),FP2)
H-7