Section 7. Installation
182
BeginProg / Scan / NextScan / EndProg Syntax
'This program example demonstrates detection and recording of an event. An event has a
'beginning and an end. This program records an event as occurring at the end of the event.
'The event recorded is the transition of a delta temperature above 3 degrees. The event is
'recorded when the delta temperature drops back below 3 degrees.
'The DataEvent instruction forces a record in data table Event each time an
'event ends. Number of events is written to the reserved variable
'EventCount(1,1). In this program, EventCount(1,1) is recorded in the
'OneMinute Table.
'Note : the DataEvent instruction must be used within a data table with a
'more frequent record interval than the expected frequency of the event.
'Declare Variables
Public
PTemp_C, AirTemp_C, DeltaT_C
Public
EventCounter
'Declare Event Driven Data Table
DataTable
(Event,True,1000)
DataEvent
(0,DeltaT_C>=3,DeltaT_C<3,0)
Sample
(1,PTemp_C, FP2)
Sample
(1,AirTemp_C, FP2)
Sample
(1,DeltaT_C, FP2)
EndTable
'Declare Time Driven Data Table
DataTable
(OneMin,True,-1)
DataInterval
(0,1,Min,10)
Sample
(1,EventCounter, FP2)
EndTable
BeginProg
Scan
(1,Sec,1,0)
'Wiring Panel Temperature
PanelTemp
(PTemp_C,_60Hz)
'Type T Thermocouple measurements:
TCDiff
(AirTemp_C,1,mV20C,1,TypeT,PTemp_C,True,0,_60Hz,1,0)
'Calculate the difference between air and panel temps
DeltaT_C = AirTemp_C - PTemp_C
'Update Event Counter (uses special syntax Event.EventCount(1,1))
EventCounter = Event.EventCount(1,1)
'Call data table(s)
CallTable
(Event)
CallTable
(OneMin)
NextScan
EndProg
7.7.1.2 Conditional Output
CRBasic example Conditional Output
(p. 183)
demonstrates conditionally sending
data to a data table based on a trigger other than time.
Summary of Contents for CR3000 Micrologger
Page 2: ......
Page 3: ......
Page 4: ......
Page 6: ......
Page 30: ......
Page 34: ......
Page 36: ......
Page 96: ......
Page 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Page 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Page 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Page 496: ......
Page 502: ......
Page 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Page 566: ......
Page 594: ......
Page 598: ......
Page 600: ......
Page 602: ......
Page 624: ......
Page 642: ......
Page 643: ......