Campbell Scientific CR800 and CR850 Measurement and Control Systems User Manual
Page 363

Section 8. Operation
363
Table 90. DataQuery API Command Parameters
uri
Optional. Specifies the URI
(p. 447)
for data to be queried. Syntax:
dl:tablename.fieldname
. Field
name is optional. Field name is always specified in association with a table name. If field name
is not specified, all fields are collected. If
fieldname
refers to an array without a subscript, all
values associated with that array will be output. Table name is optional. If table name is not
used, the entire URI syntax is not needed as
dl
(CR800) is the default data source.
mode
Required. Modes for temporal-range of collected-data:
most-recent
returns data from the most recent number of records.
p1
specifies maximum number
of records.
since-time
returns most recent data since a certain time.
p1
specifies the beginning time stamp
(see Time Syntax
(p. 358)
section).
since-record
returns records
(p. 440)
since a certain record number. The record number is specified
by
p1.
If the record number is not present in the table, the CR800 will return all data starting with
the oldest record.
date-range
returns data in a certain date range. The date range is specified using
p1
and
p2
. Data
returned include data from date specified by
p1
but not by
p2
(half-open interval).
backfill
returns data stored since a certain time interval (for instance, all the data since 1 hour ago).
The interval, in seconds, is specified using
p1
.
p1
Optional. Specifies:
•
maximum number of records (
most-recent
)
•
beginning date and/or time (
since-time
,
date-range
). See Time Syntax
(p. 358)
for
format.
•
beginning record number (
since-record
)
•
interval in seconds (
backfill
)
p2
Optional. Specifies:
•
ending date and/or time (
date-range
). See Time Syntax
(p. 358)
for format.
format
Optional. Specifies the format of the output. If this parameter is omitted, or if the value is html,
empty, or invalid, the output is HTML.
format
Option
Data Output Format
Content-Type Field of
HTTP Response Header
html
HTML
text/html
xml
CSIXML
text/xml
json
CSIJSON
application/json
toa5
TOA5
text/csv
tob1
TOB1
binary/octet-stream
Note:
When
json
is used, and the web server has a large data set to send, the web server may
choose to break the data into multiple requests by specifying a value of
true
for the
more
flag in
the CSIJSON output. The
more
flag is not shown if a complete data set is first returned.
Examples:
http://192.168.24.106/?command=DataQuery&uri=dl:MainData&mode=da
te-range&p1=2012-09-14T8:00:00&p2=2012-09-14T9:00:00
Response: collect all data from table MainData within the
range of p1 to p2*