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

Appendix I., Using MD485 Multidrop Modems with AVW200 Interfaces, AVW200s PBA1 and PBA5.

Page 109 highlights

Appendix I. Using MD485 Multidrop Modems with AVW200 Interfaces 'CR1000 Series Datalogger 'This program measures 2 sensors on 2 AVW200s PBA1 and PBA5. 'Each AVW200 is connected to a MD485 via a RS-232 null modem. The RS-232 baud rate of the MD485s 'is 38.4 k as is the RS-485 baud rate. The MD485s are set to Pakbus Network 'the Thermister reading is converted from Ohms to Deg C Public PTemp, batt_volt Public Dst(2,6) Public TempC(2), TempK(2) Public Rf(2) Public result(2) 'ABC=temp coefficients for the Steinhart-Hart equation to convert Ohms to TempC const A=.001403040 Const B=.000237318 const C=.00000009 DataTable (AVW200,1,-1) DataInterval (0,10,Sec,10) Sample (6,Dst(1,1),IEEE4) Sample (6,Dst(2,1),IEEE4) EndTable DataTable (AVWcard,1,-1) CardOut (0 ,-1) DataInterval (0,10,Sec,10) Sample (6,Dst(1,1),IEEE4) Sample (6,Dst(2,1),IEEE4) EndTable BeginProg SerialOpen (ComRS232,38400,0,0,10000) Scan (10,Sec,0,0) PanelTemp (PTemp,250) Battery (Batt_volt) 'Result, comport,neighbor,PBA,Dst,chan,muxchan,reps,begFreq,endFreq,Vx,IntegrationTime,Mult,Offset) 'sensor 1, channel 1 AVW200(result(1),ComRS232,1,1,Dst(1,1),1,1,1,1000,3500,2,_60HZ,1,0) 'sensor 2, channel 2 AVW200(result(2),ComRS232,5,5,Dst(2,1),1,1,1,1000,3500,2,_60HZ,1,0) Rf(1)=Dst(1,6) Rf(2)=Dst(2,6) TempK(1) = 1/(A + B*LN(Rf(1)) + C*(LN(Rf(1)))^3) TempK(2) = 1/(A + B*LN(Rf(2)) + C*(LN(Rf(2)))^3) TempC(1) = TempK(1)-273.15 TempC(2) = tempK(2)-273.15 CallTable avw200 CallTable avwcard NextScan EndProg I-5

  • 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 I.
Using MD485 Multidrop Modems with AVW200 Interfaces
'CR1000 Series Datalogger
'This program measures 2 sensors on 2
AVW200s PBA1 and PBA5.
'Each AVW200 is connected to a MD485 via a RS-232 null modem. The RS-232 baud rate of the MD485s
'is 38.4 k as is the RS-485 baud rate. The MD485s are set to Pakbus Network
'the Thermister reading is converted from Ohms to Deg C
Public PTemp, batt_volt
Public Dst(2,6)
Public TempC(2), TempK(2)
Public Rf(2)
Public result(2)
'ABC=temp coefficients for the Steinhart-Hart equation to convert Ohms to TempC
const A=.001403040
Const B=.000237318
const C=.00000009
DataTable (AVW200,1,-1)
DataInterval (0,10,Sec,10)
Sample (6,Dst(1,1),IEEE4)
Sample (6,Dst(2,1),IEEE4)
EndTable
DataTable (AVWcard,1,-1)
CardOut (0 ,-1)
DataInterval (0,10,Sec,10)
Sample (6,Dst(1,1),IEEE4)
Sample (6,Dst(2,1),IEEE4)
EndTable
BeginProg
SerialOpen (ComRS232,38400,0,0,10000)
Scan (10,Sec,0,0)
PanelTemp (PTemp,250)
Battery (Batt_volt)
'Result, comport,neighbor,PBA,Dst,chan,muxchan,reps,begFreq,endFreq,Vx,IntegrationTime,Mult,Offset)
'sensor 1, channel 1
AVW200(result(1),ComRS232,1,1,Dst(1,1),1,1,1,1000,3500,2,_60HZ,1,0)
'sensor 2, channel 2
AVW200(result(2),ComRS232,5,5,Dst(2,1),1,1,1,1000,3500,2,_60HZ,1,0)
Rf(1)=Dst(1,6)
Rf(2)=Dst(2,6)
TempK(1) = 1/(A + B*LN(Rf(1)) + C*(LN(Rf(1)))^3)
TempK(2) = 1/(A + B*LN(Rf(2)) + C*(LN(Rf(2)))^3)
TempC(1) = TempK(1)-273.15
TempC(2) = tempK(2)-273.15
CallTable avw200
CallTable avwcard
NextScan
EndProg
I-5