Skip to main content
Version: 8.3

system.historian.queryAnnotations

This function is used in Python Scripting.

Description​

Queries annotations for the specified historian.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.historian.queryAnnotations(paths, startDate, [endDate], [allowedTypes])

Parameters​

TypeParameterDescription
ListpathsA list of historical paths to query annotations for.
DatestartDateA start time to query annotations for.
DateendDateAn end time to query annotations for. [optional]
ListallowedTypesA list of string types to query annotations for. [optional]

Available options include:
  • note: User-stored text note
  • marker: Point-in-time marker
  • range: Date range indicator, requires an endTime value
  • trace: X-trace marker

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