The following feature is new in Ignition version 8.1.0
Click here to check out the other new features
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

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.

PropertyDescription
pathRepresents the tag path associated with the annotation.
typeRepresents the type of annotation.
rangeStartThe start time of the annotation.
rangeEndThe end time of the annotation.
dataAny 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. 
deletedFlag representing if the entries are deleted or not. 
Code Examples
Code Snippet
paths = ["[My-Provider]Station_1/ph"]
annotations = system.tag.queryAnnotations(paths)


for i in annotations:
	print i.storageId
Keywords

system tag queryAnnotations, tag.queryAnnotations