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 />

Minimum(1,AirTemp_C,FP2,0,False)<br />

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

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

EndTable<br />

'Stores temperature minimum in low<br />

'resolution format<br />

'Stores temp difference sample in low<br />

'resolution format<br />

'Stores how many data events in low<br />

'resolution format<br />

BeginProg<br />

'A second way of naming a station is to load the name into a string variable. The is<br />

'place here so it is executed only once, which saves a small amount of program<br />

'execution time.<br />

SiteName = "<strong>CR1000</strong>SiteName"<br />

Scan(1,Sec,1,0)<br />

'Measurements<br />

'Battery Voltage<br />

Battery(Batt_Volt)<br />

'Wiring Panel Temperature<br />

PanelTemp(PTemp_C,_60Hz)<br />

'Type T Thermocouple measurements:<br />

TCDiff(AirTemp_C,1,mV2_5C,1,TypeT,PTemp_C,True,0,_60Hz,1,0)<br />

TCDiff(AirTemp_F,1,mV2_5C,1,TypeT,PTemp_C,True,0,_60Hz,1.8,32)<br />

'Convert from degree C to degree F<br />

AirTemp2_F = AirTemp_C * 1.8 + 32<br />

'Count the number of times through the program. This demonstrates the use of a<br />

'Long integer variable in counters.<br />

Counter = Counter + 1<br />

'Calculate the difference between air and panel temps<br />

DeltaT_C = AirTemp_C - PTemp_C<br />

'Control the flag based on the difference in temperature. If DeltaT >= 3 then<br />

'set Flag 1 high, otherwise set it low<br />

If DeltaT_C >= 3 Then<br />

Flag(1) = high<br />

Else<br />

Flag(1) = low<br />

EndIf<br />

'Turn LED connected to Port 1 on when Flag 1 is high<br />

If Flag(1) = high Then<br />

PortSet(1,1)<br />

'alternate syntax: PortSet(1,high)<br />

Else<br />

PortSet(1,0)<br />

'alternate syntax: PortSet(1,low)<br />

EndIf<br />

245

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

Saved successfully!

Ooh no, something went wrong!