beautypg.com

Campbell Scientific AVW200-series Vibrating Wire Interfaces User Manual

Page 109

background image

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