beautypg.com

8 serial i/o – Campbell Scientific CR3000 Micrologger User Manual

Page 205

background image

Section 7. Installation

205

 

#ElseIf

LoggerType = CR800

Const

SourcSerialPort = Com1

#Else

Const

SourcSerialPort = Com1

#EndIf

'Public Variables

Public

ValueRead, SelectedSpeed

As String

* 50

'Main Program

BeginProg

'Return the selected speed and logger type for display.

#If

LoggerType = CR3000

SelectedSpeed = "CR3000 running at " & Speed & " intervals."

#ElseIf

LoggerTypes = CR1000

SelectedSpeed = "CR1000 running at " & Speed & " intervals."

#ElseIf

LoggerType = CR800

SelectedSpeed = "CR800 running at " & Speed & " intervals."

#Else

SelectedSpeed = "Unknown Logger " & Speed & " intervals."

#EndIf

'Open the serial port

SerialOpen

(SourcSerialPort,9600,10,0,10000)

'Main Scan

Scan

(ScanRate,Sec,0,0)

'Measure using different parameters and a different SE channel depending

'on the datalogger type the program is running in.

#If

LoggerType = CR3000

'This instruction is used if the logger is a CR3000

VoltSe

(ValueRead,1,mV1000,22,0,0,_50Hz,0.1,-30)

#ElseIf

LoggerType = CR1000

'This instruction is used if the logger is a CR1000

VoltSe

(ValueRead,1,mV2500,12,0,0,_50Hz,0.1,-30)

#ElseIf

LoggerType = CR800

'This instruction is used if the logger is a CR800 Series

VoltSe

(ValueRead,1,mV2500,3,0,0,_50Hz,0.1,-30)

#Else

ValueRead = NaN

#EndIf

NextScan

EndProg

 

7.8.8 Serial I/O

The CR3000 communicates with smart sensors that deliver measurement data
through serial data protocols.

Read More! See Telecommunications and Data Retrieval

(p. 354)

for background

on CR3000 serial communications.