Specifications
Section 9. CR1000 Programming
9-14
9.7.1.1 DataTable() and EndTable()
The DataTable instruction has three parameters: a user-specified alphanumeric
name for the table (e.g., “OneMin”), a trigger condition (e.g., “True”), and the
size to make the table in RAM (e.g., auto allocated).
• Name -- The table name can be any combination of numbers and letters up
to 20 characters in length. The first character must be a letter.
• TrigVar -- The trigger condition may be a variable, expression, or
constant. The trigger is true if it is not equal to 0 or “false”. Data are
stored if the trigger is true and there are no other conditions to be met.
TrigVar is a powerful tool. Read Section 11.10 for more
information on using TrigVar in special applications.
• Size - Table size is the number of records to store in a table before new
data begins overwriting old data. If “-1” is entered, memory for the table
is determined (auto-allocated) by the CR1000.
EXAMPLE creates a data table named “OneMin”, stores data once a minute as
d
efined by DataInterval(), and retains the most recent records in RAM, up to an
automatically allocated memory limit (auto allocation code =
-1).
9.7.1.2 DataInterval()
Add something about open interval and closed interval. Historic note: CR10X
data being on an “open interval.”
DataInterval() sets the period at which data are stored. It as four parameters:
• time into interval
• interval on which data are stored
• units for time
• number of lapses or gaps in the interval to track
If a DataInterval() instruction is used in the data table declaration, a timestamp
will not be stored for each record. This feature reduces memory required for
the data table. When data are downloaded to a PC, timestamps are calculated
from the data storage interval set in DataInterval() and the time of the most
recent record. As each new record is stored, the current timestamp is compared
with the last known stored record. If, based on the interval and these
timestamps, the CR1000 determines a record has been skipped, a timestamp
will be stored with the data. This discontinuity in records is termed a “lapse.”
If the lapse parameter is set to zero, a timestamp will be stored with each
record.
NOTE