You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: DOCUMENTATION.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -146,14 +146,14 @@ A few notes on the above example:
146
146
147
147
- The `requestLoggedNodes()` call returns an array of node info objects. Each object has at least `{ name: string, routing: string }` and possibly a `tags` object if tags are supported and fetched. The `tags` object is a dictionary of tagName -> `{ value: any, source: string }`. For example, a node could have `node.tags.Unit = { value: "°C", source: "CDPStudio" }` indicating the engineering unit is degrees Celsius.
148
148
149
-
You can also request historical **data points** for one or more signals using `client.requestDataPoints(names, startTimeSec, endTimeSec, numberOfPoints)`. For example:
149
+
You can also request historical **data points** for one or more signals using `client.requestDataPoints(nodeNames, startS, endS, noOfDataPoints, limit)`. For example:
150
150
151
151
```js
152
152
constlimits=awaitclient.requestLogLimits();
153
153
conststart=limits.startS;
154
154
constend=limits.endS;
155
155
// Request 100 data points for signals "Temperature" and "Pressure" over the full range
The above demonstrates retrieving 100 aggregated data points between the earliest and latest logged times. Each data point might represent an interval of time within the range, with `min`, `max`, and `last` values of the signal during that interval (this is how the CDP Logger provides downsampled data). If you instead want full resolution data, you can specify `numberOfPoints = 0` to get all points (be careful with performance if the range is large). You can also specify a `limit` (max number of points) separate from the number of intervals, as well as request specific aggregation methods.
172
+
The above demonstrates retrieving 100 aggregated data points between the earliest and latest logged times. Each data point might represent an interval of time within the range, with `min`, `max`, and `last` values of the signal during that interval (this is how the CDP Logger provides downsampled data). If you instead want full resolution data, you can specify `noOfDataPoints = 0` to get all points (be careful with performance if the range is large). You can also specify a `limit` (max number of points) separate from the number of intervals, as well as request specific aggregation methods.
173
173
174
174
Finally, to retrieve **events**, you can use `client.requestEvents(query)` along with constructing a query object. You can also use `client.countEvents(query)` to just get the count. Here’s a brief Node example for events:
175
175
176
176
```js
177
+
// Helpful enums from the client for query construction
0 commit comments