Section 7. Installation
321
the program can be coded to parse the response and issue subsequent SDI-12
commands based on a customized evaluation of the response. See
Serial I/O
Input Programming Basics
(p. 363).
Using an SDI-12 Extended Command
'This program example demonstrates the use of SDI-12 extended commands. In this example,
'a temperature measurement, tt.tt, is sent to a CH200 Charging Regulator using the command
'XTtt.tt!'. The response from the CH200 should be '0OK', if 0 is the SDI-12 address.
'
'Declare Variables
Public
PTemp
As Float
Public
SDI12command
As String
Public
SDI12result
As String
'Main Program
BeginProg
Scan
(20,Sec,3,0)
PanelTemp
(PTemp,250)
SDI12command = "XT" & FormatFloat(PTemp,"%4.2f") & "!"
SDI12Recorder
(SDI12result,C3,0,SDI12command,1.0,0)
NextScan
EndProg
7.7.15.3 SDI-12 Sensor Mode
The CR6 can be programmed to act as an SDI-12 recording device or as an
SDI-12 sensor.
For troubleshooting purposes, responses to SDI-12 commands can be captured in
programmed mode by placing a variable declared
As String
in the variable
parameter. Variables not declared
As String
will capture only numeric data.
Another troubleshooting tool is the terminal-mode snoop utility, which allows
monitoring of SDI-12 traffic. Enter terminal mode as described in
SDI-12
Transparent Mode
(p. 308),
issue CRLF (
<Enter>
key) until CR6> prompt appears.
Type
W
and then
<Enter>
. Type
9
in answer to
Select:
,
100
in answer to
Enter
timeout (secs):
,
Y
to
ASCII (Y)?
. SDI-12 communications are then opened for
viewing.
The
SDI12SensorSetup()
/
SDI12SensorResponse()
instruction pair programs
the CR6 to behave as an SDI-12 sensor. A common use of this feature is the
transfer of data from the CR6 to other Campbell Scientific dataloggers over a
single-wire interface (terminal configured for SDI-12 to terminal configured for
SDI-12), or to transfer data to a third-party SDI-12 recorder.
Details of using the
SDI12SensorSetup()
/
SDI12SensorResponse()
instruction
pair can be found in the
CRBasic Editor Help
. Other helpful tips include:
Concerning the
Reps
parameter in the
SDI12SensorSetup()
, valid
Reps
when
expecting an
aMx!
command range from 0 to 9. Valid
Reps
when expecting an
aCx!
command are 0 to 20. The
Reps
parameter is not range-checked for valid
entries at compile time. When the SDI-12 recorder receives the sensor response
of
atttn
to a
aMx!
command, or
atttnn
to a
aCx!
command, only the first digit
n
,
or the first two digits
nn
, are used. For example, if
Reps
is mis-programmed as
Summary of Contents for CR6 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 76: ...Section 5 Overview 76 FIGURE 20 Half Bridge Wiring Example Wind Vane Potentiometer ...
Page 80: ...Section 5 Overview 80 FIGURE 23 Pulse Input Wiring Example Anemometer ...
Page 136: ......
Page 454: ...Section 8 Operation 454 FIGURE 104 Narrow Sweep High Noise ...
Page 459: ...Section 8 Operation 459 FIGURE 106 Vibrating Wire Sensor Calibration Report ...
Page 535: ...Section 8 Operation 535 8 11 2 Data Display FIGURE 121 CR1000KD Displaying Data ...
Page 537: ...Section 8 Operation 537 FIGURE 123 CR1000KD Real Time Custom ...
Page 538: ...Section 8 Operation 538 8 11 2 3 Final Storage Data FIGURE 124 CR1000KD Final Storage Data ...
Page 539: ...Section 8 Operation 539 8 11 3 Run Stop Program FIGURE 125 CR1000KD Run Stop Program ...
Page 541: ...Section 8 Operation 541 FIGURE 127 CR1000KD File Edit ...
Page 546: ......
Page 552: ......
Page 610: ...Section 11 Glossary 610 FIGURE 137 Relationships of Accuracy Precision and Resolution ...
Page 612: ......
Page 648: ......
Page 650: ......
Page 688: ......
Page 689: ......