Campbell CR800 Specifications Page 102

  • Download
  • Add to my manuals
  • Print
  • Page
    / 324
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 101
Section 4. CRBasic - Native Language Programming
Average is an output processing instruction that will output the average of a
variable over the output interval. The parameters are repetitions - the number
of elements in an array to calculate averages for, the Source variable or array to
average, the data format to store the result in (Table 4.3-1), and a disable
variable that allows excluding readings from the average if conditions are not
met. A reading will not be included in the average if the disable variable is not
equal to 0; the example has 0 entered for the disable variable so all readings are
included in the average.
TABLE 4.3-1 Formats for Output Data
Code Data Format Size Range Resolution
FP2 Campbell Scientific floating point 2 bytes
±7999
13 bits (about 4 digits)
IEEE4 IEEE four byte floating point 4 bytes 1.8 E -38 to 1.7 E 38 24 bits (about 7 digits)
LONG 4 byte Signed Integer 4 bytes -2,147,483,648 to
+2,147,483,647
1 bit (1)
BOOLEAN 4 byte Signed Integer 4 bytes 0, -1 True or False (-1 or 0)
STRING ASCII String Set by
programmer
4.3.2 The Scan -- Measurement Timing and Processing
Once you know what you want, the measurements and calculations have been
listed and the output tables defined, the program itself may be relatively short.
The executable program begins with BeginProg and ends with EndProg. The
measurements, processing, and calls to output tables bracketed by the Scan and
NextScan instructions determine the sequence and timing of the datalogging.
BeginProg
Scan(1,Sec,3,0)
ModuleTemp(RefTemp, 250)
TCDiff(TC(),6,mV2_5C,4,1,TypeT,RefTemp,RevDiff,Del,Integ,Mult,Offset)
CallTable Temp
NextScan
EndProg
The Scan instruction determines how frequently the measurements within the
scan are made:
' Scan(Interval, Units, BufferSize, Count)
Scan(1,Sec,3,0)
The Scan instruction has four parameters. The Interval is the interval between
scans. Units are the time units for the interval. The minimum interval is 10
milliseconds. The maximum scan interval is 30 minutes. The BufferSize is the
size (in the number of scans) of a buffer in RAM that holds the raw results of
measurements. Using a buffer allows the processing in the scan to at times lag
behind the measurements without affecting the measurement timing (see the
scan instruction in Section 9 for more details). Count is the number of scans to
make before proceeding to the instruction following NextScan. A count of 0
means to continue looping forever (or until ExitScan). In the example the scan
4-6
Page view 101
1 2 ... 97 98 99 100 101 102 103 104 105 106 107 ... 323 324

Comments to this Manuals

No comments