
A Short Cut tutorial is available in
(p. 2). If you wish to import Short Cut code into
CRBasic Editor to create or add to a customized program, follow the procedure in
Short Cut code into CRBasic Editor
(p. 14). Programming basics for CRBasic data loggers are
provided in the following section. Downloadable example programs are available at
www.campbellsci.com/downloads/windsonic4-program-examples
7.4.1 Programming
The WindSonic4 updates the SDI-12 output at a frequency of 1 Hz. The
SDI12Recorder()
CRBasic instruction programs the data loggers to measure the WindSonic4. This instruction sends
a request to the sensor to make a measurement and then retrieves the measurement from the
sensor. For the most data loggers, the
SDI12Recorder()
instruction has the following syntax:
SDI12Recorder
(Destination, SDIPort, SDIAddress, “SDICommand”, Multiplier,
Offset, FillNAN, WaitonTimeout)
For the
SDIAddress
, alphabetical characters need to be enclosed in quotes (for example, “A”).
Also enclose the
SDICommand
in quotes as shown. The most appropriate SDI-12 command to
retrieve data from the WindSonic4 is the
Ro!
, where
o
is the data format option (
9)). When using the
"Ro!"
command, the
Destination
parameter needs to be a variable
array with three elements.
FillNAN
and
WaitonTimeout
are optional parameters (refer to CRBasic Help for more
information).
When using a CR200(X)-series data logger, the
SDI12Recorder()
instruction has the
following syntax:
SDI12Recorder
(Destination,"OutString",Multiplier,Offset)
OutString
consists of the SDI-12 address and command. Enclose the
OutString
in quotes
as shown.
Table 7-2: WindSonic4 data format option
Option (o)
Output
Units
Comment
0
wind direction degrees
Compass polar coordinate system
wind speed
m/s
status
unitless
1
u
x
wind
m/s
Orthogonal right hand coordinate system
u
y
wind
m/s
status
unitless
WindSonic4 Two-Dimensional Sonic Anemometer
9