04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 7. Installation<br />

CRBasic Example 35.<br />

Using an SDI‐12 Extended Command<br />

'SDI-12 extended command "XT23.61!" sent to CH200 Charging Regulator<br />

'Correct response is "0OK", if zero (0) is the SDI-12 address.<br />

'<br />

'Declare Variables<br />

Public SDI12command As String<br />

Public SDI12result As String<br />

'Main Program<br />

BeginProg<br />

Scan(20,Sec,3,0)<br />

SDI12command = "XT" & FormatFloat(PTemp,"%4.2f") & "!"<br />

SDI12Recorder(SDI12result,1,0,SDI12command,1.0,0)<br />

NextScan<br />

EndProg<br />

7.8.3.2.2 SDI-12 Sensor Mode<br />

The SDI12SensorSetup() / SDI12SensorResponse() instruction pair programs<br />

the <strong>CR1000</strong> to behave as an SDI-12 sensor. A common use of this feature is the<br />

transfer of data from the <strong>CR1000</strong> to other <strong>Campbell</strong> <strong>Scientific</strong> dataloggers over a<br />

single-wire interface (SDI-12 port to SDI-12 port), or to transfer data to a thirdparty<br />

SDI-12 recorder.<br />

Details of using the SDI12SensorSetup() / SDI12SensorResponse() instruction<br />

pair can be found in the CRBasic Editor Help. Other helpful tips include:<br />

Concerning the Reps parameter in the SDI12SensorSetup(), valid Reps when<br />

expecting an aMx! command range from 0 to 9. Valid Reps when expecting an<br />

aCx! command are 0 to 20. The Reps parameter is not range-checked for valid<br />

entries at compile time. When the SDI-12 recorder receives the sensor response<br />

of atttn to a aMx! command, or atttnn to a aCx! command, only the first digit n,<br />

or the first two digits nn, are used. For example, if Reps is mis-programmed as<br />

123, the SDI-12 recorder will accept only a response of n = 1 when issuing an<br />

aMx! command, or a response of nn = 12 when issuing an aCx! command.<br />

• When programmed as an SDI-12 sensor, the <strong>CR1000</strong> will respond to a<br />

variety of SDI-12 commands including aMx! and aCx!. The following rules<br />

apply:<br />

1. A <strong>CR1000</strong> can be assigned only one SDI-12 address per SDI-12 port. For<br />

example, a <strong>CR1000</strong> will not respond to both 0M! AND 1M! on SDI-12 port<br />

C1. However, different SDI-12 ports can have unique SDI-12 addresses. Use<br />

a separate SlowSequence for each SDI-12 port configured as a sensor.<br />

2. The <strong>CR1000</strong> will handle Additional Measurements (aMx!) commands. When<br />

an SDI-12 recorder issues aMx! commands as shown in CRBasic example<br />

SDI-12 Sensor Setup (p. 185), measurement results are returned as listed in table<br />

CRBasic example SDI-12 Sensor Setup -- Results (p. 185).<br />

184

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!