Programming with the AVW200() instruction

When using the RS-232 (PakBus) or RF (PakBus) protocol, the data logger is programmed using the AVW200() instruction in CRBasic.

NOTE:

If using SDI-12 to communicate with the AVW200, then use the SDI12Recorder() instruction to trigger and retrieve measurements from the AVW200 (see Programming for SDI-12 measurements).

The AVW200() instruction is used to read measurements from one or more vibrating-wire sensors when the sensors are connected to the AVW200 channels directly or connected to a multiplexer attached to the AVW200. In addition to frequency, diagnostic information is returned. (Refer to the Dest parameter in the following section.)

The data logger program can run the AVW200() instruction in either the pipeline mode (Pipeline mode) or sequential mode (Sequential mode). In the pipeline mode, the first execution of the instruction sets up the AVW200; subsequent execution intervals retrieve data values. If different begin and end frequencies are required to measure different types of sensors, use multiple AVW200() instructions with the different begin and end frequencies specified in each instruction. The sequential mode performs each instruction in sequence, waits for the completion of each instruction, then repeats this process for each execution interval. The minimum scan rate for an AVW200 program is 2 seconds per sensor.

Syntax

 
AVW200 (Result, ComPort, NeighborAddr, PakBusAddr, Dest, AVWChan, MuxChan, Reps, BeginFreq, EndFreq, ExVolt, Therm50_60Hz, Multiplier, Offset, AmpThreshold [optional])
 

Result

Result Variable that indicates the success or failure of the communications attempt of the data logger with the AVW200. If more than one AVW200 is used and the instructions are run in sequential mode, a different result variable should be specified for each AVW200 (see Sequential mode). The result codes are as follows:

Code

Description

0

Communications successful. Values have been written to the destination array.

>1

Number of communications failures. NAN values will be stored in the destination array. Resets to 0 upon successful communications.

–3

First communication. Values will be available on the next scan.

ComPort

ComPort Used to specify the communications port that will be used to communicate with the AVW200. Enter a numeric or alphanumeric code:

Alphanumeric

Description

ComRS232

AVW200 connects to data logger RS-232 port via null modem cable

ComME

RF401A connects to data logger CS I/O port; RF401A configured as modem enabled

ComSDC7

RF401A connects to data logger CS I/O port; RF401A configured as SDC7

ComSDC8

RF401A connects to data logger CS I/O port; RF401A configured as SDC8

ComSDC10

RF401A connects to data logger CS I/O port; RF401A configured as SDC10

ComSDC11

RF401A connects to data logger CS I/O port; RF401A configured as SDC11

ComC1

AVW200 connects to data logger control ports C1/C2 via DB9 serial cable

ComC3

AVW200 connects to data logger control ports C3/C4 via DB9 serial cable

ComC5

AVW200 connects to data logger control ports C5/C6 via DB9 serial cable

ComC7

AVW200 connects to data logger control ports C7/C8 via DB9 serial cable

NeighborAddr

Used to specify a static route to the AVW200 (for example, the PakBus address of a neighbor device through which the host can communicate with the AVW200). If 0 is entered, the AVW200 is assumed to be a neighbor, meaning that the host data logger can communicate with the AVW200 directly.

PakBusAddr

Parameter to identify the PakBus address of the AVW200 with which the host data logger is trying to communicate. Valid entries are 1 through 4094. Each PakBus device in the network must have a unique address.

Dest

Variable array in which to store the results of the instruction. If only one sensor is being measured, Dest is a single-dimensioned array of five if no thermistor is being measured or six if a thermistor is. Dest is a multi-dimensioned array of five (no thermistor) or six (with thermistor) if multiple sensors are being measured using a multiplexer. The first dimension is set equal to the number of sensors being measured, and the second dimension is set equal to the number of values returned for each sensor (5 or 6). For example, to measure four sensors with thermistor measurements attached to a multiplexer, Dest would be declared as Array(4,6). Values for sensor 1 would be stored in Array(1,1) through Array(1,6), values for sensor 2 stored in Array(2,1) through Array(2,6), and so on.

The values returned for each sensor are:

(1)

Resonant frequency in Hz

(2)

Response amplitude in mV RMS

(3)

Signal-to-noise ratio

(4)

Noise frequency

(5)

Decay ratio

(6)

Thermistor in ohms (if measured)

The units and description of these values are provided in AVW200 measurement outputs.

If communications are unsuccessful, NANs are stored.

NOTE:

When using the CRBasic AVW200() instruction, the signal strength amplitude in mV RMS ( Dest[2] ) has a minimum resolution of 0.0625 mV (62.5 microvolts). This means that values between 0.01 and 0.06249 mV (10 and 62.49 microvolts) will be given as 0. Values between 0.0625 and 0.1249 will be given as 0.0625. Values between 0.125 and 0.18749 will be given as 0.125, and so forth. With firmware Std.04 and higher, values less than 0.01 will be shown as NAN; older firmware will show them as 0.

To see amplitudes with higher resolution, use SDI-12 (), Terminal mode (Terminal), or the Troubleshoot tab in Device Configuration Utility (Troubleshoot) to examine signal strength amplitude values.

AVWChan

Channel on the AVW200 where the sensor or multiplexer is wired. Valid options are 1 (+/–1VDC) or 2 (+/–2VDC).

MuxChan

Channel on the multiplexer where measurements should start. Valid options are 1 through 32; anything outside this range returns an error. Enter 1 if a multiplexer is not used.

Reps

Number of measurements to be made on the multiplexer. This parameter does not affect AVW200Chan.

BeginFreq

Beginning frequency to use for the vibrating-wire measurement. Minimum possible value is 100. Refer to the specifications of the vibrating-wire sensor for recommended BeginFreq values.

EndFreq

Ending frequency to use for the vibrating-wire measurement. Maximum possible value is 6500; typical sweep range is 450 to 6000. Refer to the specifications of the vibrating-wire sensor for recommended EndFreq values.

ExVolt

Excitation voltage to be used to excite the vibrating wire. Valid options are 1 (5 VDC peak-to-peak) or 2 (12 VDC peak-to-peak).

Therm50_60Hz

Used to set the integration time for the thermistor in the vibrating-wire sensor.

Code

Description

0

No thermistor measurement (five values returned in Dest)

_60Hz   

Use 60 Hz noise rejection (six values returned in Dest)

_50Hz   

Use 50 Hz noise rejection (six values returned in Dest)

Multiplier

Multiplier to be used for frequency measurements.

Offset

Offset to be used for frequency measurements.

AmpThreshold

(for data logger OS versions 23 and higher) Optional parameter that is used to define a minimum value in mV for the amplitude of the signal. If an amplitude less than the threshold is measured, NAN (invalid) will be stored for the frequency measurement. If AmpThreshold is omitted, a default value of 0.01 mV is used. If a value <0.01 mV is entered for this parameter, the precompiler will return an error.

NOTE:

The signal strength amplitude ( (2) ) returned by the AVW200() CRBasic instruction is limited in its resolution.To avoid unexpected results, use a value that is an integer multiple of 0.0625 for the AmpThreshold parameter.