'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,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
'Update Event Counter (uses special syntax Event.EventCount(1,1))
EventCounter = Event.EventCount(1,1)
'Call data table(s)
CallTable(Event)
CallTable(OneMin)
NextScan
7.9.1.2 Conditional Output
CRBasic example Conditional Output (p. 170) demonstrates programming to output
data to a data table conditional on a trigger other than time.
CRBasic Example 23. Conditional Output
'This program example demonstrates the conditional writing of data to a data table. It
'also demonstrates use of StationName() and Units instructions.
'Declare Station Name (saved to Status table)
StationName(Delta_Temp_Station)
'Declare Variables
Public PTemp_C, AirTemp_C, DeltaT_C
170