Skip to main content
Version: 8.3

system.historian.queryRawPoints

This function is used in Python Scripting.

Description​

Queries raw data points for the specified historian.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.historian.queryRawPoints(paths, startTime, endTime, [columnNames], [returnFormat], [returnSize], includeBounds, [excludeObservations])

Parameters​

TypeParameterDescription
ListpathsA list of historical paths to query aggregated data points for.
DatestartTimeA start time to query aggregated data points for.
DateendTimeAn end time to query aggregated data points for.
ListcolumnNamesA list of alias column names for the returned dataset. [Optional]
StringreturnFormatThe desired return format for the query. [Optional]

Available options include:
  • WIDE: One value per path per row: [path1_val, path2_val, ..., timestamp] (default)
  • TALL: One value per row: [path, value, quality, timestamp]
  • CALCULATION: Calculated result per path aggregate
IntegerreturnSizeThe maximum number of results to return. [Optional]
BooleanincludeBoundsWhether to include the bounds in the query results.
BooleanexcludeObservationsWhether to exclude observed aggregated data points in the query results. When applied, observed values, such as periodic samples from Tag Group evaluations will be filtered out, while source values, such as tag changes from devices will remain in the returned dataset. [Optional]

Returns​

Dataset - A dataset representing the raw data points for the specified historical paths.

Scope​

Gateway, Vision Client, Perspective Session

Code Examples​

Code Snippet 1
# Query a specified historical simulator tag path and display raw data from within the past minute.

end = system.date.now()
start = system.date.addMinutes(end, -1)

myDataset = system.historian.queryRawPoints(["[default]_Simulator_/Random/RandomInteger1"], start, end, includeBounds=False)

for row in myDataset:
print row[0], row[1]
Code Snippet 2
# Query specified historian tag paths and display raw data from within the past hour 
# applying alias column names and return size and format configurations.

results = system.historian.queryRawPoints(
paths=[
"histprov:CoreHistorian:/sys:gateway:/prov:default:/tag:Folder/MyTag",
"histprov:CoreHistorian:/sys:gateway:/prov:default:/tag:Folder/OtherTag"
],
startTime=system.date.addHours(system.date.now(), -1),
endTime=system.date.now(),
columnNames=["MyTagAlias", "OtherTagAlias"],
returnFormat="WIDE",
returnSize=1000,
includeBounds=True,
excludeObservations=False
)
for row in range(results.rowCount):
print(results.getValueAt(row, "timestamp"), results.getValueAt(row, "MyTagAlias"))