Specifications

Section 4. CRBasic - Native Language Programming
4-13
Public Pressure(3), Mult(3), Offset(3)
DataTable (AvgPress,1,-1)
DataInterval (0,60,Min,10)
Average (3,Pressure(),IEEE4,0)
EndTable
BeginProg
'Calibration Factors:
Mult(1)=0.123 : Offset(1)=0.23
Mult(1)=0.115 : Offset(1)=0.234
Mult(1)=0.114 : Offset(1)=0.224
Scan (1,Sec,10,0)
'VoltSe instruction using array of multipliers and offsets:
VoltSe (Pressure(),3,mV5000,1,True,0,_60Hz,Mult(),Offset())
CallTable AvgPress
NextScan
EndProg
4.9 Program Access to Data Tables
Data stored in a table can be accessed from within the program. The format
used is:
Tablename.Fieldname(fieldname index,records back)
Where Tablename is the name of the table in which the desired value is stored.
Fieldname is the name of the field in the table. The fieldname is always an
array even if it consists of only one variable; the fieldname index must always
be specified. Records back is the number of records back in the data table
from the current time (1 is the most recent record stored, 2 is the record stored
prior to the most recent). For example, the expression:
Tdiff=Temp.TC_Avg(1,1)–Temp.TC_Avg(1,2)
could be used in the example program (Section 4.3) to calculate the change in
the 10 minute average temperature of the first thermocouple between the most
recent average and the one that occurred ten minutes earlier.
In addition to accessing the data actually output in a table, there is additional
information about the data table that can be retrieved using the same
Tablename.fieldname syntax.
Tablename.record(1,n) = the record number of the record output n records ago.
Tablename.output(1,1) = -1 if data were output to the table the last time the
table was called, = 0 if data were not output.