system.historian.queryAnnotations
This function is used in Python Scripting.
Descriptionβ
Queries annotations for the specified historian's set of paths within a given time range.
Client Permission Restrictionsβ
This scripting function has no Client Permission restrictions.
Syntaxβ
system.historian.queryAnnotations(paths, startDate, [endDate], [allowedTypes])
Parametersβ
| Type | Parameter | Description |
|---|---|---|
| List | paths | A list of historical paths to query annotations for. See Path Syntax for more information on recommended syntax. |
| Date | startDate | A start time to query annotations for. |
| Date | endDate | An end time to query annotations for. [optional] |
| List | allowedTypes | A list of string types to query annotations for. [optional] Available options include:
|
Returnsβ
Results - A Results object that contains a list of query results.
Scopeβ
Gateway, Vision Client, Perspective Session
Code Examplesβ
Code Snippet
# Query for a specified tag's annotations and display the result.
paths = "histprov:QuestDB_Historian:/sys:Historian-gw1:/prov:default:/tag:MetaFolder/MetaTag1"
endDate = system.date.now()
startDate = system.date.addHours(endDate, -5)
results = system.historian.queryAnnotations(paths, startDate, endDate)
for result in results.getResults():
print result