Query Data
About this task
- Selecting the tags: You can select tags from all the tags in the system. While selecting tags, you can view them in a hierarchical object model view or in a flat list.
- Applying conditions and filters: You can select the sampling mode, size, query modifiers, and so on. You can also select the calculation modes for the calculated sampling mode.
- Generating the report: You can plot the query results in a trend chart or view them in a table. You can also export the data.
Procedure
- Access Configuration Hub.
-
In the NAVIGATION section, under the Configuration Hub
plugin for Historian, select Data.
The Data section appears, displaying a list of object instances and the underlying variables and contained types hierarchically. If you want to view a flat list of all the tags, select .
- Select the tags for which you want to query data, select Read data operation, and then select Next. You can select up to 10 tags.
-
Enter values as described in the following table.
Field Description START DATE/TIME Enter the start date and time for the query. END DATE/TIME Enter the end date and time for the query. SAMPLING MODES Select the sampling mode for the query: - Calculated: Returns the result of a calculation on tag values (for example, count, maximum, delta).
- Current Value: Returns a single sample containing the current value of the tag. Retrieves the timestamp, value, and quality.
- Interpolated: Returns the interpolated tag values.
- Interpolated to Raw
- Lab: Returns only collected values. Each collected value is repeated until the next collected value, resulting in a jagged step plot instead of a smooth curve.
- Lab to Raw
- Raw By Number: Returns the specified number of raw samples of all qualities beginning with the start time and moving in the specified direction.
- Raw By Time: Returns all raw samples of all qualities with a timestamp greater than the start time and less than or equal to the end time. It will not return a raw sample with same time stamp as the start time.
- Trend: Returns significant points, which are raw samples. These points are determined by finding the raw minimum and raw maximum values within each interval.
- Trend to Raw
- Trend to Raw2
- Trend2: Splits up a given time period into a number of intervals (using either a specified number of samples or specified interval length), and returns the minimum and maximum data values that occur within the range of each interval, together with the timestamps of the raw values. This sampling mode is suitable for analysis of minimum and maximum values and for plotting programs that can handle unevenly spaced data.
CALCULATION MODE Select the calculation mode that you want to use. This field appears only if you select Calculated in the SAMPLING MODES field. For information on calculation modes, refer to Calculation Modes. SAMPLING DIRECTION The direction in which you want to retrieve the query results: - Forward: Returns query results starting from the start data to the end date.
- Backward: Returns query results starting from the end date to the start data.
SAMPLE INCREMENT Identifies the amount of data samples in each sample: - By Size: Select this option if you want each sample to contain a specific number of data points, and then enter the number of data points.
- By Time: Select this option if you want each sample to contain data points collected for a specified duration, and then enter the duration.
QUERY MODIFIERS Used for retrieving a specific set of data. For information, refer to Query Modifiers. Filters You can enter your filter conditions using the Filter tag, the Filter Condition, and the Filter Comparison Value.
In the Filter Tag Name field, select the tag you want to enable filtering with.
In the Condition field, select your comparison condition.
In the Value field, enter your filter condition value. -
Select Generate Report.
The query results for the selected tags are plotted on a trend chart.
You can narrow down the start and end dates by dragging the timeline below the trend chart.
The Tags and query criteria appear in the Summary section; you can edit them if needed.
Select the Edit beside Tag Selection and Query Builder to modify tags and query criteria.
You can save the query if you may frequently use to read specific tags data with a specific query criteria. For more information, refer to Save a query.
If you want to export the results into a .csv file, select . The results are exported.
If you want to print the trend, select , and then select Print.
To export into other formats (such as a .pdf, .svg, .png, or .jpeg), select , and then select the format.