Scan(1,Sec,1,0)
'Measurements
'Battery Voltage
Battery(Batt_Volt)
'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)
TCDiff(AirTemp_F,1,mV2_5C,1,TypeT,PTemp_C,True,0,_60Hz,1.8,32)
'Convert from degree C to degree F
AirTemp2_F = AirTemp_C * 1.8 + 32
'Count the number of times through the program. This demonstrates the use of a
'Long integer variable in counters.
Counter = Counter + 1
'Calculate the difference between air and panel temps
DeltaT_C = AirTemp_C - PTemp_C
'Control the flag based on the difference in temperature. If DeltaT >= 3 then
'set Flag 1 high, otherwise set it low
If DeltaT_C >= 3 Then
Flag(1) = high
Else
Flag(1) = low
EndIf
'Turn LED connected to Port 1 on when Flag 1 is high
If Flag(1) = high Then
PortSet(1,1) 'alternate syntax: PortSet(1,high)
Else
PortSet(1,0) 'alternate syntax: PortSet(1,low)
EndIf
'Count how many times the DataEvent “DeltaT_C>=3” has occurred. The
'TableName.EventCount syntax is used to return the number of data storage events
'that have occurred for an event driven table. This example looks in the data
'table “Event”, which is declared above, and reports the event count. The (1,1)
'after EventCount just needs to be included.
HowMany = Event.EventCount(1,1)
'Call Data Tables
CallTable(OneMin)
CallTable(Event)
NextScan
EndProg
176