beautypg.com

5 sdi-12 example, Sdi-12 example, N 7.5 – Campbell Scientific AVW200-series Vibrating Wire Interfaces User Manual

Page 59

background image

AVW200-series 2-Channel Vibrating Wire Spectrum Analyzer Modules

Const Chan1 = 1

' AVW200 channel 1

Const Chan2 = 2

' AVW200 channel 2

Const MuxChan = 1

' Starting Mux Channel

Const Reps = 1

' Number of Reps

Const BFreq = 450

' Begin Frequency

Const EFreq = 6000

' End Frequency

Const Xvolt = 2

' 12p-p Volt Excite

Dim tmpavw200(6)

BeginProg

SerialOpen (Com1,38400,0,0,0)

Scan (64,Sec,0,0)

' (2 * 32 measurement) = 64 seconds

PanelTemp (PTemp,250)

Battery (Batt_volt)

PortSet(3, 1)

' Reset High Mux On, both mux's share the RST

Delay(1, 100, mSec)

' before clocking

For x = 1 To 16

PulsePort(4, 2000)

' Advance Mux #1 on C4 port (clock high for 2mSec)

PulsePort(5, 2000)

' Advance Mux #2 on C5 (clock high for 2mSec)

Delay(1, 10, mSec)

' Mux Settling Time

AVW200(Result1,Com1,200,200,tmpavw200(1),Chan1,MuxChan,Reps,Bfreq,Efreq,Xvolt,_60Hz,1,0)

Move(AVWDst(x,1),6,tmpavw200(1),6)

' now copy tmp value to the Dst

AVW200(Result2,Com1,200, 00,tmpavw200(1),Chan2,MuxChan,Reps,Bfreq,Efreq,Xvolt,_60Hz,1,0)

Move(AVWDst(x+16,1),6,tmpavw200(1),6)

' now copy tmp value to the Dst

Next

PortSet(3, 0)

' Reset Low Mux off

NextScan

EndProg

7.5 SDI-12 Example

The following program is an example of how to run the AVW200 with a

CR1000 using the SDI12Recorder( ) instruction. Note that the values returned

from the SDI12Recorder( ) instruction are different depending on the SDI-12

measurement command issued.

For this example, two multiplexers are measured by the datalogger. The

AVW200 interface module cannot control multiplexers in the SDI-12

communication mode. Hence, when communicating to the AVW200 via SDI-

12, any multiplexers attached to the AVW200 must be controlled by the

datalogger. This is achieved by using PortSet instructions in the datalogger

program (see example below) and by connecting the clock and reset lines of the

multilplexers to control ports on the datalogger. When using SDI-12 with the

AVW200, the clock and reset lines of the AVW200 are not used.

Extended SDI-12 commands can be used to change the begin, end frequencies

and the excitation voltage of the vibrating wire sensors attached to the

AVW200. However, these extended SDI-12 commands only work for the next

measurement command. By default, standard SDI-12 measurement commands

use the begin/end/excite voltage settings specified in the AVW200 settings

using DevConfig. However, after issuing an extended SDI-12 command, the

51