7.4 Programming
Short Cut
is the best source for up-to-date programming code for Campbell Scientific data
loggers. If your data acquisition requirements are simple, you can probably create and maintain a
data logger program exclusively with
Short Cut
. If your data acquisition needs are more complex,
the files that
Short Cut
creates are a great source for programming code to start a new program
or add to an existing custom program.
NOTE:
Short Cut
cannot edit programs after they are imported and edited in
CRBasic Editor
.
A
Short
Cut
tutorial
is
available
in
If
you
wish
to
import
Short
Cut
code
into
CRBasic
Editor
to
create
or
add
to
a
customized
program,
follow
the
procedure
in
Programming
basics
for
CRBasic
data
loggers
are
provided
in
the
following
section.
Downloadable
example
programs
are
available
at
/downloads/cs225-example-programs
7.4.1
SDI12Recorder()
instruction
The
SDI12Recorder()
instruction
is
used
to
measure
the
temperature
sensors
in
the
CS225.
This
instruction
sends
a
request
to
the
sensor
to
make
a
measurement
and
then
retrieves
the
measurement
from
the
sensor.
See
for
more
information.
For
most
data
loggers,
the
SDI12Recorder()
instruction
has
the
following
syntax:
SDI12Recorder
(Destination, SDIPort, SDIAddress, “SDICommand”, Multiplier, Offset,
FillNAN, WaitonTimeout)
Each temperature sensor in the CS225 needs a unique SDI-12 address. For the
SDIAddress
,
alphabetical characters need to be enclosed in quotes (for example, “A”). Also enclose the
SDICommand
in quotes as shown. The
Destination
parameter must be an array. The required
number of values in the array depends on the command (
FillNAN
and
WaitonTimeout
are optional parameters (refer to
CRBasic Help
for more
information).
7.4.2 Slow sequence program instructions
Use the slow sequence program instructions when the CS225 measurements will exceed the
program scan interval of the additional instruments included in the station. For example, if a
CS225 consists of 17 or more temperature sensors, the time required to poll all sensors and
receive data can be greater than 5 seconds based on the 300 ms execution time for the
aR0!
command. For more details on the use of the slow sequence program instructions, reference the
CS225 Temperature String
10