04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 8. Operation<br />

Table 94. DataQuery API Command Parameters<br />

uri<br />

mode<br />

Optional. Specifies the URI (p. 470) for data to be queried. Syntax: dl:tablename.fieldname. Field<br />

name is optional. Field name is always specified in association with a table name. If field name<br />

is not specified, all fields are collected. If fieldname refers to an array without a subscript, all<br />

values associated with that array will be output. Table name is optional. If table name is not<br />

used, the entire URI syntax is not needed as dl (<strong>CR1000</strong>) is the default data source.<br />

Required. Modes for temporal-range of collected-data:<br />

most-recent returns data from the most recent number of records. p1 specifies maximum number<br />

of records.<br />

since-time returns most recent data since a certain time. p1 specifies the beginning time stamp<br />

(see Time Syntax (p. 375) section).<br />

since-record returns records (p. 463) since a certain record number. The record number is specified<br />

by p1. If the record number is not present in the table, the <strong>CR1000</strong> will return all data starting<br />

with the oldest record.<br />

date-range returns data in a certain date range. The date range is specified using p1 and p2. Data<br />

returned include data from date specified by p1 but not by p2 (half-open interval).<br />

backfill returns data stored since a certain time interval (for instance, all the data since 1 hour ago).<br />

The interval, in seconds, is specified using p1.<br />

Optional. Specifies:<br />

• maximum number of records (most-recent)<br />

p1<br />

• beginning date and/or time (since-time, date-range). See Time Syntax (p. 375) for<br />

format.<br />

• beginning record number (since-record)<br />

• interval in seconds (backfill)<br />

p2<br />

Optional. Specifies:<br />

• ending date and/or time (date-range). See Time Syntax (p. 375) for format.<br />

Optional. Specifies the format of the output. If this parameter is omitted, or if the value is html,<br />

empty, or invalid, the output is HTML.<br />

format Option<br />

Data Output Format<br />

Content-Type Field of<br />

HTTP Response Header<br />

html HTML text/html<br />

xml CSIXML text/xml<br />

format<br />

json CSIJSON application/json<br />

toa5 TOA5 text/csv<br />

tob1 TOB1 binary/octet-stream<br />

Note: When json is used, and the web server has a large data set to send, the web server may<br />

choose to break the data into multiple requests by specifying a value of true for the more flag in<br />

the CSIJSON output. The more flag is not shown if a complete data set is first returned.<br />

Examples:<br />

http://192.168.24.106/command=DataQuery&uri=dl:MainData&mode=da<br />

te-range&p1=2012-09-14T8:00:00&p2=2012-09-14T9:00:00<br />

Response: collect all data from table MainData within the<br />

range of p1 to p2*<br />

380

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!