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

'Begin Program<br />

BeginProg<br />

'Load scaling array (multipliers and offsets)<br />

Mult(1) = 1.8 : Offset(1) = 32<br />

Mult(2) = 1 : Offset(2) = 2<br />

Mult(3) = 1 : Offset(3) = 3<br />

Mult(4) = 1 : Offset(4) = 4<br />

Mult(5) = 1 : Offset(5) = 5<br />

Mult(6) = 1 : Offset(6) = 6<br />

Mult(7) = 1 : Offset(7) = 7<br />

Mult(8) = 1 : Offset(8) = 8<br />

Mult(9) = 1 : Offset(9) = 9<br />

Mult(10) = 1 : Offset(10) = 10<br />

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

'Measure reference temperature<br />

PanelTemp(PTemp_C,_60Hz)<br />

'Measure 5 thermocouples on <strong>CR1000</strong><br />

'Note: because of the use of repetitions, an array can be used for the<br />

'destination, multiplier and offset.<br />

TCDiff(Temp_C(),5,mV2_5C,1,TypeT,PTemp_C,True ,0,250,Mult(),Offset())<br />

'Measure 5 thermocouples on an AM16/32 Multiplexer (2x32 mode)<br />

PortSet(1,1)<br />

Count = 6 'Start with 6 since scaling arrays 1 – 5<br />

'already used<br />

SubScan(0,uSec,5)<br />

PulsePort(2,10000)<br />

TCDiff(Temp_C(Count),1,mV2_5C,6,TypeT,PTemp_C,True,0,_60Hz,Mult(Count),Offset(Count))<br />

Count = Count + 1<br />

NextSubScan<br />

PortSet(1,0)<br />

CallTable(min_5)<br />

NextScan<br />

EndProg<br />

7.8.17.6 Conditional Output<br />

CRBasic example Conditional Output (p. 251) demonstrates programming to output<br />

data to a data table conditional on a trigger other than time.<br />

CRBasic Example 57.<br />

Conditional Output<br />

'Programming example showing use of StationName instruction, use of units, and writing<br />

'to a data table conditionally<br />

'Declare Station Name (saved to Status table)<br />

StationName(Delta_Temp_Station)<br />

'Declare Variables<br />

Public PTemp_C, AirTemp_C, DeltaT_C<br />

251

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

Saved successfully!

Ooh no, something went wrong!