Section 7. Installation
information on parsing strings, see
Input Programming Basics
(p. 251).
CRBasic Example 57.
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,1,0,SDI12command,1.0,0)
NextScan
EndProg
7.9.18.3 SDI-12 Sensor Mode
The CR1000 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. 267),
issue CRLF (
<Enter>
key) until CR1000> 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 CR1000 to behave as an SDI-12 sensor. A common use of this feature is the
transfer of data from the CR1000 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
123, the SDI-12 recorder will accept only a response of
n
= 1 when issuing an
aMx!
command, or a response of
nn
= 12 when issuing an
aCx!
command.
279
Summary of Contents for CR1000
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Page 96: ......
Page 98: ...98 ...
Page 302: ......
Page 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Page 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Page 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Page 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Page 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Page 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Page 478: ......
Page 506: ......
Page 536: ......
Page 636: ......
Page 642: ......
Page 644: ......
Page 676: ......
Page 677: ......