
Section 4. CRBasic - Native Language Programming
4.3 Example Program
Const RevDiff=1
Const Del=0 'default
Const Integ=250
Const Mult=1
Const Offset=0
Public RefTemp
Public TC(6)
Units RefTemp=degC
Units TC=DegC
DataTable (Temp,1,2000)
DataInterval (0,10,min,10)
Average (1,RefTemp,FP2,0)
Average (6,TC(),FP2,0)
EndTable
Declarations
Declare constants
Declare public variables ,
dimension array, and
declare units.
Define Data Table
BeginProg
Scan (1,Sec,3,0)
PanelTemp (RefTemp, 250)
TCDiff (TC(),6,mV2_5C ,1,TypeT,RefTemp,RevDiff,Del,Integ,Mult,Offset)
CallTable Temp
NextScan
Measure
Call Data Table
Scan loop
EndProg
4.3.1 Data Tables
Data storage follows a fixed structure in the CR800 in order to optimize the
time and space required. Data are stored in tables such as:
TOA5 Fritz CR800 1079 CR800.Std.1.0 CPU:TCTemp.CR8 51399 Temp
TIMESTAMP RECORD RefT_Avg TC_Avg(1) TC_Avg(2) TC_Avg(3) TC_Avg(4) TC_Avg(5) TC_Avg(6)
TS RN degC DegC DegC DegC DegC DegC DegC
Avg Avg Avg Avg Avg Avg Avg
10/28/2004 12:10 119 23.52 23.49 23.49 23.5 23.49 23.5 23.5
10/28/2004 12:20 120 23.55 23.51 23.51 23.51 23.51 23.51 23.52
10/28/2004 12:30 121 23.58 23.52 23.53 23.53 23.53 23.53 23.53
10/28/2004 12:40 122 23.58 23.53 23.54 23.54 23.54 23.54 23.54
The user's program determines the values that are output and their sequence.
The CR800 automatically assigns names to each field in the data table. In the
above table, TIMESTAMP, RECORD, RefTemp_Avg, and TC_Avg(1) are
fieldnames. The fieldnames are a combination of the variable name (or alias if
one exists) and a three letter mnemonic for the processing instruction that
outputs the data. Alternatively, the FieldNames instruction can be used to
override the default names.
4-4
Komentáře k této Příručce