system.tag.queryAnnotations
New in 8.1.0
This function is used in Python Scripting.
Description​
Queries annotations stored in the Tag History system for a set of paths for a given time range.
Client Permission Restrictions​
This scripting function has no Client Permission restrictions.
Syntax​
system.tag.queryAnnotations(paths, [startTime], [endTime], [types])
Parameters​
Type | Parameter | Description |
---|---|---|
List[String] | paths | A list of tag paths to query. The paths are equivalent to what would be used for a Tag History Query, and should specify the Source Providers as well. For example, [HistoryProvider/Gateway:Provider]Path/To/Tag . |
Date | startTime | The start of the time range. If not defined, defaults to 12 hours ago. [optional] |
Date | endTime | The end of the time range. If not defined, defaults to "now". [optional] |
List[String] | types | A list of string "types" to filter on. Types are defined by the annotations and various subsystems, and may vary with different providers. Possible annotation types are listed on the system.tag.storeAnnotations page. [optional] |
Returns​
List[Annotation] - A list of Annotation objects that match the query criteria.
Scope​
Gateway, Vision Clients, Perspective Sessions
The Annotation Object​
Properties on the annotation objects returned by this function can be references by name (i.e., Annotation.storageId). The table below represent properties on the object.
Property | Description |
---|---|
path | Represents the tag path associated with the annotation. |
type | Represents the type of annotation. |
rangeStart | The start time of the annotation. |
rangeEnd | The end time of the annotation. |
data | Any data (such as a description, or user entered text) associated with the annotation. |
storageId | Represents the ID value of the annotation, as listed in the sqlth_annotations table. Used in conjunction with the system.tag.storeAnnotations to change existing annotations, and system.tag.deleteAnnotations to remove annotations. |
deleted | Flag representing if the entries are deleted or not. |
Code Examples​
Example #1
paths = ["[My-Provider]Station_1/ph"]
annotations = system.tag.queryAnnotations(paths)
for i in annotations:
print i.storageId