5 programming the datalogger – Campbell Scientific Wireless Sensor Network (CWB100, CWS220, and CWS900) User Manual

Page 33

Advertising
background image

Wireless Sensor Network

transmitted by wireless sensors. See Section 4.2.1 for more information on the
format and use of the configuration string.

After the configuration settings have been sent to the base station and wireless
sensors, the sensor configuration file may be sent to the datalogger. The
datalogger must then be programmed to access that file using the third
parameter of the CWB100 instruction. See Section 5 for programming details.

To send the sensor configuration file to the datalogger, connect a serial cable or
USB-to-serial cable to the RS-232 port between the computer and the
datalogger.

Select the Send a sensor configuration file to the datalogger attached item
in the Configure Devices list, then select

Click Here

. Enter the correct COM

port number for the cable that attaches to the datalogger. Ensure that the
datalogger is powered as described in the dialog box. The datalogger’s PakBus
address does not need to be specified for this transaction but if a security code
is present in the datalogger, that code needs to be entered in the Datalogger
Security Code field. Click Connect to send the configuration file to the
datalogger.

3.5 Programming the Datalogger

The datalogger program must include a destination array large enough to store
all the values returned by the wireless sensors and a scan that includes a
CWB100() instruction. The scan interval must be large enough to allow the
sensors time to transmit.

In this example, the program will simply collect data from the two wireless
sensors once per minute and store a sample of each value collected. For
additional details and advanced programming examples, see Section 4.

Begin by opening the CRBasic editor in LoggerNet, PC400 or RTDAQ
software. Select New CR1000 Program File to begin editing the datalogger
program. For information on writing datalogger programs or using the
CRBasic editor, see the CR1000 and LoggerNet manuals. Additionally, the
CRBasic editor help file has an example program for the wireless sensor
instructions.

25

Advertising