beautypg.com

2 datalogger programming, 1 get data command, 2 crbasic instruction sequence – Campbell Scientific CS526 ISFET pH Probe User Manual

Page 15: Datalogger programming, Get data command, Crbasic instruction sequence, 2. “get data” command and response, 3. instruction sequence

background image

CS526 ISFET pH Probe

7.2 Datalogger Programming

7.2.1 Get Data Command

The datalogger needs to send a “get data” serial command to the CS526 to get

the pH data. This command is sent to the CS526 via the

SerialOut() CRBasic

instruction (see Section 7.2.3.2, SerialOut() Instruction). TABLE 7-2 shows

the “get data” command and its response.

TABLE 7-2. “Get Data” Command and Response

Command

Response

aMn!

Where:

a = probe address (factory

default is 1)

n = a single dummy character

(typically use 1)

a

Where:

a = probe address (factory default is 1)

= the probe’s reading for pH

(in digital counts).

7.2.2 CRBasic Instruction Sequence

A sequence of CRBasic instructions is used to measure the sensor. TABLE 7-3

shows the instruction sequence. Information about the instructions is provided

in Section 7.2.3, Instruction Descriptions, and an example program is provided

in Appendix B, Example Program.

TABLE 7-3. Instruction Sequence

Instruction

Function

SerialOpen() Set up a datalogger port for serial communication (see Section

7.2.3.1, SerialOpen() Instruction)

Scan()

Establish a scan rate

SerialOut()

Send “get data” command to the CS526.
See Section 7.2.1, Get Data Command, and 7.2.3.2,

SerialOut() Instruction, for more information.

SerialIn()

Set up the COM port to receive the incoming serial data (see

Section 7.2.3.3, SerialIn() Instruction).
Please note that in the beginning of the CRBasic program, the

variable used in the

SerialIn() instruction needs to be

declared as an ASCII string format.

SplitStr()

Split out digital count value for pH from the input string.

Probe output is “Counts”. A corrected multiplier and offset are

required to provide an output in pH units (see Appendix C,

Calibration).

NOTE

7