Campbell-scientific CR800 and CR850 Measurement and Control Systems Instrukcja Użytkownika Strona 253

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
Przeglądanie stron 252
Section 7. Installation
253
'Declare Units
Units PTemp_C = deg C
Units AirTemp_C = deg C
Units DeltaT_C = deg C
'Declare Output Table -- Output Conditional on Delta T >=3
'Table stores data at the Scan rate (once per second) when condition met
'because DataInterval instruction is not included in table declaration.
DataTable(DeltaT,DeltaT_C >= 3,-1)
Sample(1,Status.StationName,String)
Sample(1,DeltaT_C,FP2)
Sample(1,PTemp_C,FP2)
Sample(1,AirTemp_C,FP2)
EndTable
BeginProg
Scan(1,Sec,1,0)
'Measure wiring panel temperature
PanelTemp(PTemp_C,_60Hz)
'Measure type T thermocouple
TCDiff(AirTemp_C,1,mV2_5C,1,TypeT,PTemp_C,True,0,_60Hz,1,0)
'Calculate the difference between air and panel temps
DeltaT_C = AirTemp_C - PTemp_C
'Call data table(s)
CallTable(DeltaT)
NextScan
EndProg
7.8.17.7 Capturing Events
CRBasic example Capturing Events (p. 253) demonstrates programming to output
data to a data table at the occurrence of an event.
CRBasicExample58. BeginProg/Scan/NextScan/EndProgSyntax
'Example programming to detect and record 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
Przeglądanie stron 252
1 2 ... 248 249 250 251 252 253 254 255 256 257 258 ... 565 566

Komentarze do niniejszej Instrukcji

Brak uwag