beautypg.com

3 multiple switch closure measurements, 4 sdi-12 sensor support, 1 sdi-12 command basics – Campbell Scientific CR200/CR200X-series Dataloggers User Manual

Page 124: Cr200(x)

background image

Section 11. Programming Resource Library

11.3 Multiple Switch Closure Measurements

Pulse channel P_SW detects switch closures but P_LL does not. In order to

detect more than one switch closure device, a 100kOhm pull-up resistor must be

connected between Battery+ and P_LL, C1, or C2. With the pull-up resistor in

place P_LL or the control port can detect a switch closure. In the following

example

p. 112, note that the PulseCount instruction for P_SW uses

configuration option 2 (Switch Closure), while P_LL must use option 0 (Pulse

Input).

CRBASIC EXAMPLE 18.

CRBASIC EXAMPLE. Two Rain Gages on a CR200(X)

'Rain(1) is wired to P_SW and Ground

'Rain(2) is wired to P_LL and Ground with a

'100,000 ohm resistor connecting P_LL to Battery+

Public Rain(2)

Units Rain()=mm

DataTable(Hourly,True,-1)

DataInterval(0,60,Min)

Totalize(2,Rain(),False)

EndTable

BeginProg

Scan(10,Sec)

PulseCount(Rain(1),P_SW,2,0,0.254,0)

PulseCount(Rain(2),P_LL,0,0,0.254,0)

CallTable(Hourly)

NextScan

EndProg

11.4 SDI-12 Sensor Support

11.4.1 SDI-12 Command Basics

Commands have three components:

Sensor address (a) – a single character, and is the first character of the

command. Sensors are usually assigned a default address of zero by the

manufacturer. Wildcard address (?) is used in Address Query command.

Some manufacturers may allow it to be used in other commands.

Command body (e.g., M1) – an upper case letter (the “command”) followed

by alphanumeric qualifiers.

Command termination (!) – an exclamation mark.

An active sensor responds to each command. Responses have several standard

forms and terminate with (carriage return – line feed).

112