Campbell Scientific CR3000 Micrologger User Manual

Page 220

Advertising
background image

Section 7. Installation

220 

 

 

recognize the C command. CR3000 dataloggers, however, require custom
programming to output and accept these same ASCII strings. A similar program
can be used to emulate CR10X and CR23X dataloggers.

Solution: CRBasic example Measure Sensors / Send RS-232 Data

(p. 220)

imports

and exports serial data via the CR3000 RS-232 port. Imported data are expected
to have the form of the legacy Campbell Scientific time set C command. Exported
data has the form of the legacy Campbell Scientific Printable ASCII format.

Note The nine-pin RS-232 port can be used to download the CR3000 program if
the SerialOpen() baud rate matches that of the datalogger support software

(p. 404,

p. 453).

However, two-way PakBus

®

communications will cause the CR3000 to

occasionally send unsolicited PakBus

®

packets out the RS-232 port for at least 40

seconds after the last PakBus

®

communication. This will produce some "noise" on

the intended data-output signal.

Monitor the CR3000 RS-232 port with the HyperTerminal instance described in
Configure HyperTerminal

(p. 216).

Send C-command file to set the clock according

to the text in the file.

Note The HyperTerminal file will not update automatically with actual time. The
file only simulates a clock source for the purposes of this example.

CRBasic Example 41. Measure Sensors / Send RS‐232 Data 

'CR3000 is programmed to accept legacy "C" command to set the CR3000 clock.

'Declarations

'Visible Variables

Public

StationID

Public

KWH_In

Public

KVarH_I

Public

KWHHold

Public

KVarHold

Public

KWHH

Public

KvarH

Public

InString

As String

* 25

Public

OutString

As String

* 100

'Hidden Variables

Dim

i, rTime(9), OneMinData(6), OutFrag(6)

As String

Dim

InStringSize, InStringSplit(5)

As String

Dim

Date, Month, Year, DOY, Hour, Minute, Second, uSecond

Dim

LeapMOD4, LeapMOD100, LeapMOD400

Dim

Leap4

As Boolean

, Leap100

As Boolean

, Leap400

As Boolean

Dim

LeapYear

As Boolean

Dim

ClkSet(7)

As Float

Advertising