beautypg.com

6 program example – Campbell Scientific Wireless Sensor Network (CWB100, CWS220, and CWS900) User Manual

Page 43

background image

Wireless Sensor Network

Port: The Port parameter is a constant indicating the control port (C1, C3, C5,
or C7) to which the CWB100 Data line is connected.

Routes: A destination variable of type String where the routing information
will be stored. It is important to size the variable large enough to hold all of
the routing information.

Example

Public WSNRoutes as String *100
.
.
.
Scan()
CWB100Routes(C7, WSNRoutes)
NextScan


For example, in a network with sensors named W900_006, W900_Red,
W900_39D, and W220_38F, the CWB100Routes() instruction returns the
following string:

125309400006 W900_006

12530A401388 W900_Red

12530A40139D W900_39D: 12530A401388 W900_Red

12530A40138F W220_38F

This reports that sensor W900_006 hops directly to the base station.
W900_Red also hops directly to the base station. W900_39D hops to
W900_Red and from there hops to the base station. Finally, W220_38F hops
directly to the base station.

4.6 Program Example

In example program 4.6-1, CWB100 is used to poll the CWB100 base station
every 10 minutes and CWB100RSSI is used to trigger a radio strength signal
measurement every 60 minutes. A flag called GetRSSI is available to
manually force the RSSI measurement. Sensor routes are also updated hourly.
The wireless sensor measured in this example is a CWS900 interfaced to a
109-LW temperature probe.

ArrayIndex is use in the DataTable and the disable variable is used to exclude
NAN values from influencing the average and minimum calculations.

Wiring for Example Program 4.6-1:

CWB100 Channel Wire

Color CR1000

Channel

+12V Red 12V

G Black

G

DATA/A Green C3

35