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

'Count how many times the DataEvent “DeltaT_C>=3” has occurred. The<br />

'TableName.EventCount syntax is used to return the number of data storage events<br />

'that have occurred for an event driven table. This example looks in the data<br />

'table “Event”, which is declared above, and reports the event count. The (1,1)<br />

'after EventCount just needs to be included.<br />

HowMany = Event.EventCount(1,1)<br />

'Call Data Tables<br />

CallTable(OneMin)<br />

CallTable(Event)<br />

NextScan<br />

EndProg<br />

7.8.17.2 Running Average and Total of Rain<br />

CRBasic Example 53.<br />

Running Average and Running Total of Rain<br />

'Rain is measured using PulseCount(). Running Average is calculated using the<br />

'AvgRun(). Running Total is calculated from the result of AvgRun() by<br />

'multiplying the result by the AvgRun() Number parameter (3rd parameter).<br />

Public MeasuredRain<br />

Public TotRun, RainAvg<br />

Const Number = 15.0<br />

BeginProg<br />

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

PulseCount(MeasuredRain,1,1 ,2,0,0.01,0)<br />

AvgRun(RainAvg,1,MeasuredRain,Number)<br />

TotRun = Number * RainAvg<br />

NextScan<br />

EndProg<br />

7.8.17.3 Use of Multiple Scans<br />

CRBasic example Use of Multiple Scans (p. 246) demonstrates the use of multiple<br />

scans. Some applications require measurements or processing to occur at an<br />

interval different from that of the main program scan. Secondary, or slow<br />

sequence, scans are prefaced with the SlowSequence instruction.<br />

CRBasic Example 54.<br />

Use of Multiple Scans<br />

'This program demonstrates the use of multiple scans. Some applications require<br />

'measurements or processing to occur at an interval different from that of the main<br />

'program scan. Secondary scans are prefaced with the SlowSequence instruction.<br />

'Declare Public Variables<br />

Public PTemp<br />

Public Counter1<br />

246

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

Saved successfully!

Ooh no, something went wrong!