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

'Data Tables<br />

'Table output on two intervals depending on condition.<br />

'note the parenthesis around the TriggerVariable AND statements<br />

'Status table datafilldays field is low<br />

DataTable(TwoInt,(int_fast AND TimeIntoInterval(0,5,Sec)) OR (int_slow AND _<br />

TimeIntoInterval(0,15,sec)),-1)<br />

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

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

Maximum(1,counter(1),Long,False,False)<br />

Minimum(1,counter(1),Long,False,False)<br />

Maximum(1,deltaT,FP2,False,False)<br />

Minimum(1,deltaT,FP2,False,False)<br />

Average(1,deltaT,IEEE4,false)<br />

EndTable<br />

'Main Program<br />

BeginProg<br />

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

PanelTemp(PTemp,250)<br />

Battery(Batt_volt)<br />

counter(1) = counter(1) + 1<br />

'thermocouple measurement<br />

TCDiff(AirTempC,1,mV2_5C,1,TypeT,PTemp,True ,0,250,1.0,0)<br />

'calculate the difference in air temperature and panel temperature<br />

deltaT = airtempC - PTemp<br />

'when the difference in air temperatures is >=3 turn LED on<br />

'and trigger the data table's faster interval<br />

If deltaT >= 3 Then<br />

PortSet(4,true)<br />

int_fast = true<br />

int_slow = false<br />

Else<br />

PortSet(4,false)<br />

int_fast = false<br />

int_slow = true<br />

EndIf<br />

'Call Output Tables<br />

CallTable TwoInt<br />

NextScan<br />

EndProg<br />

7.8.15 PulseCountReset Instruction<br />

PulseCountReset is used in rare instances to force the reset or zeroing of <strong>CR1000</strong><br />

pulse accumulators (see Measurement Inputs (p. 60) ).<br />

PulseCountReset is needed in applications wherein two separate PulseCount()<br />

instructions in separate scans use the same pulse-input channel. While the<br />

compiler does not allow multiple PulseCount() instructions in the same scan to<br />

use the same channel, multiple scans using the same channel are allowed.<br />

PulseCount() information is not maintained globally, but for each individual<br />

instruction occurrence. So, if a program needs to alternate between fast and slow<br />

241

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

Saved successfully!

Ooh no, something went wrong!