Section 7. Installation
191
7.7.5 Data Output: Two Intervals in One Data Table
Two Data-Output Intervals in One Data Table
'This program example demonstrates the use of two time intervals in a data table. One time
'interval in a data table is the norm, but some applications require two.
'
'Allocate memory to a data table with two time intervals as is done with a conditional table,
'that is, rather than auto-allocate, set a fixed number of records.
'Declare Public Variables
Public
PTemp, batt_volt, airtempC, deltaT
Public
int_fast
As Boolean
Public
int_slow
As Boolean
Public
counter(4)
As Long
'Declare Data Table
'
'Table is output on one of two intervals, depending on condition.
'Note the parenthesis around the TriggerVariable AND statements.
DataTable
(TwoInt,(int_fast
AND
TimeIntoInterval
(0,5,Sec))
OR
(int_slow
AND
_
TimeIntoInterval
(0,15,sec)),15000)
Minimum
(1,batt_volt,FP2,0,False)
Sample
(1,PTemp,FP2)
Maximum
(1,counter(1),Long,False,False)
Minimum
(1,counter(1),Long,False,False)
Maximum
(1,deltaT,FP2,False,False)
Minimum
(1,deltaT,FP2,False,False)
Average
(1,deltaT,IEEE4,false)
EndTable
'Main Program
BeginProg
Scan
(1,Sec,0,0)
PanelTemp
(PTemp,250)
Battery
(Batt_volt)
counter(1) = counter(1) + 1
'Measure thermocouple
TCDiff
(AirTempC,1,mV2_5C,1,TypeT,PTemp,True,0,250,1.0,0)
'calculate the difference in air temperature and panel temperature
deltaT = airtempC - PTemp
'When the difference in air temperatures is >=3 turn LED on and trigger the faster of
'the two data-table intervals.
If
deltaT >= 3
Then
PortSet
(4,true)
int_fast = true
int_slow = false
Else
PortSet
(4,false)
int_fast = false
int_slow = true
EndIf
Summary of Contents for CR800 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 34: ......
Page 54: ......
Page 92: ......
Page 310: ......
Page 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Page 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Page 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Page 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Page 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Page 456: ......
Page 462: ......
Page 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Page 524: ......
Page 526: ......
Page 556: ......
Page 558: ......
Page 560: ......
Page 597: ......