04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 7. Installation<br />

'One Minute Data Table<br />

DataTable(OneMinTable,true,-1)<br />

OpenInterval<br />

'sets interval same as found in CR510<br />

DataInterval(0,1,Min,10)<br />

Totalize(1, KWHH,FP2,0)<br />

Sample(1, KWHHold,FP2)<br />

Totalize(1, KvarH,FP2,0)<br />

Sample(1, KVarHold,FP2)<br />

Sample(1, StationID,FP2)<br />

EndTable<br />

'Clock Set Record Data Table<br />

DataTable(ClockSetRecord,True,-1)<br />

Sample(7,ClkSet(),FP2)<br />

EndTable<br />

'Subroutine to convert date formats (day-of-year to month and date)<br />

Sub DOY2MODAY<br />

'Store Year, DOY, Hour, Minute and Second to Input Locations.<br />

Year = InStringSplit(1)<br />

DOY = InStringSplit(2)<br />

Hour = InStringSplit(3)<br />

Minute = InStringSplit(4)<br />

Second = InStringSplit(5)<br />

uSecond = 0<br />

'Check if it is a leap year:<br />

'If Year Mod 4 = 0 and Year Mod 100 0, then it is a leap year OR<br />

'If Year Mod 4 = 0, Year Mod 100 = 0, and Year Mod 400 = 0, then it<br />

'is a leap year<br />

LeapYear = 0<br />

'Reset leap year status location<br />

LeapMOD4 = Year MOD 4<br />

LeapMOD100 = Year MOD 100<br />

LeapMOD400 = Year MOD 400<br />

If LeapMOD4 = 0 Then Leap4 = True Else Leap4 = False<br />

If LeapMOD100 = 0 Then Leap100 = True Else Leap100 = False<br />

If LeapMOD400 = 0 Then Leap400 = True Else Leap400 = False<br />

If Leap4 = True Then<br />

LeapYear = True<br />

If Leap100 = True Then<br />

If Leap400 = True Then<br />

LeapYear = True<br />

Else<br />

LeapYear = False<br />

EndIf<br />

EndIf<br />

Else<br />

LeapYear = False<br />

EndIf<br />

216

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

Saved successfully!

Ooh no, something went wrong!