
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.
AShort Cut tutorial is available in QuickStart (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 Importing
Short Cut code into CRBasic Editor (p. 16). Programming basics for CRBasic data loggers are
provided in the following section. Downloadable example programs are available at
www.campbellsci.com/downloads/cs230-cs231-example-programs .
7.4.1 SDI12Recorder() instruction
The SDI12Recorder() instruction is used to measure the temperature sensors in the
CS230/CS231. This instruction sends a request to the sensor to make a measurement and then
retrieves the measurement from the sensor. See Sensor measurements (p. 10) 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 CS230/CS231 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 (Table 8-1 (p. 10)).
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 CS230/CS231 measurements will exceed
the program scan interval of the additional instruments included in the station. For example, if a
CS230/CS231 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 300ms execution time for the
CS230/CS231 Temperature Profilers 9