1 crbasic, Crbasic, 2. sdi-12 command codes – Campbell Scientific CS475, CS476, and CS477 Radar Water Level Sensor User Manual
Page 26

CS475, CS476, and CS477 Radar Water Level Sensor
7.5.1 CRBasic
Dataloggers that are programmed with CRBasic include the CR200(X) series,
CR800, CR850, CR1000, CR3000, and CR5000. These dataloggers use the
SDI12Recorder() instruction to read the sensor. The SDI12Recorder()
instruction should only be ran in the sequential mode.
The values returned from the SDI12Recorder() instruction are different
depending on the SDI-12 measurement command issued. The
SDI12Recorder() instruction sends the command specified by the
SDI12Command parameter as (address)SDI12Command!.
SDI12Recorder(Dest, SDIPort, SDIAddress, “SDICommand”, Multiplier,
Offset)
The SDI12Recorder() instruction has the following parameters:
Dest The
Dest parameter is a variable in which to store the results
of the measurement. Dest must have enough elements to
store all the data that is returned by the sensor or a ‘variable
out of range’ error will result during the execution of the
instruction.
SDIPort The
SDIPort parameter is the port to which the SDI-12
sensor is connected. A numeric value is entered:
Code
Description
1
Control Port 1
3
Control Port 3
5
Control Port 5
7
Control Port 7
SDIAddress The
SDIAddress parameter is the address of the sensor that
will be affected by this instruction. Valid addresses are 0
through 9, A through Z, and a through z. Alphabetical
characters should be enclosed in quotes (for example, “0”).
SDICommand The
SDICommand parameter is used to specify the
command strings that will be sent to the sensor. The
command should be enclosed in quotes. TABLE 7-2 shows
the specific SDI-12 Command Codes and their returned
values.
TABLE 7-2. SDI-12 Command Codes
SDI12 Measurement Command
Returned Values
M!
1) Stage in meters or feet
2) Distance in meters or feet
3) Error Code (see Section 8,
Diagnostics, Repair, and
Maintenance)
18