SDI-12 example

The following program is an example of how to run the AVW200 with a CR1000Xe 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 data logger. The AVW200 interface module cannot control multiplexers in the SDI-12 communications mode. Hence, when communicating to the AVW200 via SDI-12, any multiplexers attached to the AVW200 must be controlled by the data logger. This is achieved by using PortSet() instructions in the data logger program (see the following example) and by connecting the clock and reset lines of the multiplexers to control ports on the data logger. When using SDI-12 with the AVW200, the clock and reset lines of the AVW200 are unused.

Extended SDI-12 commands can be used to change the begin frequency, end frequency, and 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 Device Configuration Utility. However, after issuing an extended SDI-12 command, the very next measurement will use the bbbb, eeee, and v values specified in the extended command. The second and remaining measurements will revert to the settings specified via Device Configuration Utility.

An example of an extended command is 0XVW450,5000,1!. This command will configure the next measurement with begin freq = 450, end freq = 5000, and 5 VDC excitation. Following the extended command, aM1! will use the parameters set by the extended command.

SDI-12 command codes shows the specific SDI-12 command codes and their returned values.

SDI-12 command codes

SDI-12 measurement command

Returned values

aM!
(measures both AVW200 channel 1 and channel 2)

1) Chan1 frequency
2) Chan1 therm resistance
3) Chan1 signal amplitude mV RMS
4) Chan2 frequency
5) Chan2 therm resistance
6) Chan2 signal amplitude mV RMS

aM1!
(measures AVW200 channel 1)

1) Chan1 Frequency
2) Chan1 signal amplitude mV RMS
3) Chan1 signal-to-noise ratio
4) Chan1 noise frequency
5) Chan1 decay ratio
6) Chan1 therm resistance

aM2!
(measures AVW200 channel 2)

1) Chan2 frequency
2) Chan2 signal amplitude mV RMS
3) Chan2 signal-to-noise ratio
4) Chan2 noise frequency
5) Chan2 decay ratio
6) Chan2 therm resistance

aV!

1) Battery voltage
2) Trapcodes
3) Watchdog counts

aXVWbbbb,eeee,v!
where:
bbbb = Begin freq (100 < bbbb < 6.5K)
eeee = End freq (100 < eeee < 6.5K)
v = Excite voltage (1= 5v VDC and 2 = 12 VDC)

Returns OK if accepted
Returns ERROR if not accepted

 

SDI-12 - data logger controlling 2 multiplexers

'Example Program running SDI12 commands with the data logger controlling

'2 mux's. For this program, the AVW SDI-12 port is connected to DL C1.

'The reset line of both muxes is connected to data logger C3. Mux1 clock line

'is connected to DL C4 and Mux2clock line is connected to DL C5. The SDI-12

'address of the AVW200 is set to 1.

 

SequentialMode

 

Public PTemp, batt_volt

Public Chan1_Val(16,6),Chan2_Val(16,6)

 

Dim I

 

BeginProg

  Scan (150,Sec,0,0)

    PanelTemp(PTemp,60)

    Battery(batt_volt)

    PortSet(C3, 1) 'Reset High, Mux On, both muxes share this reset port

    Delay(1, 100, mSec) 'delay before clocking

 

    '************ Measure 16 vibrating wire sensor on AVW200 channel 1

    For I=1 To 16

 

      'Advance Mux #1 (clock line connected to C4; clock high for 2mSec)

      PulsePort(C4, 2000)

      Delay(1, 10, mSec) 'Mux Settling Time

 

      'measures sensor on channel 1

      SDI12Recorder (Chan1_Val(I,1),C1,1,"M1!",1.0,0)

    Next I

 

    '************ Measure 16 vibrating wire sensor on AVW200 channel 2

    For I=1 To 16

 

      'Advance Mux #2 (clock line connected to C5; clock high for 2mSec)

      PulsePort(C5, 2000)

      Delay(1, 10, mSec) 'Mux Settling Time

 

      'measures sensor on channel 2

      SDI12Recorder (Chan2_Val(I,1),C1,1,"M2!",1.0,0)

    Next I

 

    PortSet(C3, 0) 'Reset Low; turn both Muxes off

  NextScan

EndProg