04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 7. Installation<br />

recognize the C command. <strong>CR1000</strong> dataloggers, however, require custom<br />

programming to output and accept these same ASCII strings. A similar program<br />

can be used to emulate CR10X and CR23X dataloggers.<br />

Solution: CRBasic example Measure Sensors / Send RS-232 Data (p. 215) imports<br />

and exports serial data via the <strong>CR1000</strong> RS-232 port. Imported data are expected<br />

to have the form of the legacy <strong>Campbell</strong> <strong>Scientific</strong> time set C command. Exported<br />

data has the form of the legacy <strong>Campbell</strong> <strong>Scientific</strong> Printable ASCII format.<br />

Note The nine-pin RS-232 port can be used to download the <strong>CR1000</strong> program if<br />

the SerialOpen() baud rate matches that of the datalogger support software (p. 399,<br />

p. 451). However, two-way PakBus ® communications will cause the <strong>CR1000</strong> to<br />

occasionally send unsolicited PakBus ® packets out the RS-232 port for at least 40<br />

seconds after the last PakBus ® communication. This will produce some "noise" on<br />

the intended data-output signal.<br />

Monitor the <strong>CR1000</strong> RS-232 port with the HyperTerminal instance described in<br />

Configure HyperTerminal (p. 211). Send C-command file to set the clock according<br />

to the text in the file.<br />

Note The HyperTerminal file will not update automatically with actual time. The<br />

file only simulates a clock source for the purposes of this example.<br />

CRBasic Example 41.<br />

Measure Sensors / Send RS‐232 Data<br />

'<strong>CR1000</strong> is programmed to accept legacy "C" command to set the <strong>CR1000</strong> clock.<br />

'Declarations<br />

'Visible Variables<br />

Public StationID<br />

Public KWH_In<br />

Public KVarH_I<br />

Public KWHHold<br />

Public KVarHold<br />

Public KWHH<br />

Public KvarH<br />

Public InString As String * 25<br />

Public OutString As String * 100<br />

'Hidden Variables<br />

Dim i, rTime(9), OneMinData(6), OutFrag(6) As String<br />

Dim InStringSize, InStringSplit(5) As String<br />

Dim Date, Month, Year, DOY, Hour, Minute, Second, uSecond<br />

Dim LeapMOD4, LeapMOD100, LeapMOD400<br />

Dim Leap4 As Boolean, Leap100 As Boolean, Leap400 As Boolean<br />

Dim LeapYear As Boolean<br />

Dim ClkSet(7) As Float<br />

215

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

Saved successfully!

Ooh no, something went wrong!