Section 7.  Installation 
 
 
'//////////////////////////// PROGRAM //////////////////////////// 
BeginProg 
 StationID = 4771 
 Scan(1,Sec, 3, 0) 
 
 '/////////////////Measurement Section//////////////////////// 
 'PulseCount(KWH_In, 1, 1, 2, 0, 1, 0)  'Activate this line in working program 
 KWH_In = 4.5          'Simulation -- delete this line from working program 
 
 'PulseCount(KVarH_I, 1, 2, 2, 0, 1, 0) 'Activate this line in working program 
 KVarH_I = 2.3         'Simulation -- delete this line from working program 
 KWHH = KWH_In 
 KvarH = KVarH_I 
 KWHHold = KWHH + KWHHold 
 KVarHold = KvarH + KVarHold 
 
 CallTable OneMinTable 
 
 '////////////////////Serial I/O Section///////////////////// 
 SerialOpen(ComRS232,9600,0,0,10000) 
 '///////////////Serial Time Set Input Section/////////////// 
 'Accept old C command -- [2008:028:10:36:22]C -- parse, process, set 
 'clock (Note: Chr(91) = "[", Chr(67) = "C") 
 SerialInRecord(ComRS232,InString,91,0,67,InStringSize,01)  
 
 If InStringSize <> 0 Then 
 SplitStr(InStringSplit,InString,"",5,0) 
 Call DOY2MODAY              'Call subroutine to convert day-of-year 
 ClkSet(1) = Year 
 ClkSet(2) = Month 
 ClkSet(3) = Date 
 ClkSet(4) = Hour 
 ClkSet(5) = Minute 
 ClkSet(6) = Second 
 ClkSet(7) = uSecond 
 'Note: ClkSet array requires year, month, date, hour, min, sec, msec 
 ClockSet(ClkSet()) 
 CallTable(ClockSetRecord) 
 EndIf 
 '/////////////////Serial Output Section///////////////////// 
 'Construct old Campbell Scientific Printable ASCII data format and output to COM1 
 
 'Read datalogger clock 
 RealTime(rTime) 
 If TimeIntoInterval(0,5,Sec) Then 
 'Load OneMinData table data for processing into printable ASCII 
 GetRecord(OneMinData(),OneMinTable,1)