Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Historian

aaEventTagInsert

  • Last UpdatedMar 10, 2025
  • 4 minute read

Inserts an event tag.

Syntax

aaEventTagInsert TagName, Description, CreatedBy, DateCreated, CurrentEditor, ScanRate, TimeDeadband, Logged, Status, PostDetectorDelay, UseThreadPool, DetectorTypeKey, DetectorString, ActionTypeKey, ActionString, Priority, Edge

where:

Argument

Description

TagName

The unique name of the tag within the AVEVA Historian system. This value is of data type nvarchar(256), with no default.

Description

The description of the tag. This value is of data type nvarchar(512), with a default of an empty string.

CreatedBy

The name of the user or application that created the tag. This value is of data type nvarchar(256), with a default of an empty string.

DateCreated

The date that the tag was created. This value is of data type datetime2(7), with a default of NULL.

CurrentEditor

Used to specify which application or editing environment controls the tag definition. Tags imported from the InTouch HMI software use InTouch as the current editor. If modifications are made to an imported tag in the historian Configuration Editor, then the current editor for the tag is changed to AVEVA Historian. If a re-import is performed, any modifications made using the Configuration Editor are preserved. You can manually maintain InTouch as the current editor for re-importing; however, all changes made to the tag using the Configuration Editor are lost during the re-import. Tags (attributes) that are initially configured using AVEVA Application Server use the ArchestrA Integrated Development Environment (IDE) as the current editor. If you modify an Application Server tag using the historian Configuration Editor, then the current editor for the tag is changed to AVEVA Historian. However, the next time you redeploy the engine, the changes are not preserved.

0 = AVEVA Historian

1 = InTouch

2 = AVEVA Application Server

This value is of data type int, with a default of 0.

ScanRate

The interval, in milliseconds, at which the system checks to see if the event conditions specified by the detector occurred. This value must be greater than or equal to 500 milliseconds, and less than or equal to 1 hour (3600000 ms). This value is of data type int, with a default of 0.

TimeDeadband

The minimum time, in milliseconds, between stored values for a single tag. Any value changes that occur within the time deadband are not stored. The time deadband applies to delta storage only. A time deadband of 0 indicates that the system will store the value of the tag each time it changes. This value is of data type int, with a default of 0.

Logged

Used to specify whether or not to log events for this tag into the EventHistory table. Event logging can only be turned off if no associated actions are configured.

0 = Not logged

1 = Logged

This value is of data type bit, with a default of 0.

Status

The flag used by the event system at system startup and during runtime to determine if the event tag has been modified.

0 = Posted. Any changes have been detected and effected by the system.

1 = New. An event tag has been inserted, but is not yet executing.

2 = Modification. An event tag has been updated, but the older one is already executing.

98 = Disabled.

99 = Disabling requested. The event tag does not execute, even though the definition still exists in the schema. Note that there may be a delay of up to 30 seconds before a change in an event tag is seen by the running system.

This value is of data type tinyint, with a default of 0.

PostDetectorDelay

The amount of time, in milliseconds, that must elapse after an event is detected before the event action can be executed. This value is of data type int, with a default of 0.

UseThreadPool

To specify how system threads are used to process events.

1 = All events are handled by a single thread and a single logon to the SQL Server;

0 = Each event uses a separate system thread and logon. This will allow the Event subsystem to manage the scan rates of each detector component concurrently. (Reserved for future use.)

This value is of data type bit, with a default of 1.

DetectorTypeKey

The unique identifier of a particular type of detector. Event tags and detectors are linked by means of this key. The event system relies on the following values, which are added during installation:

1 = System

2 = External event

3 = Generic SQL

4 = Analog specific value

5 = Discrete specific value

6 = Time-based (schedule)

This value is of data type int, with a default of 0.

DetectorString

The script that contains the criteria for event detection. Detector scripts are executed on the local AVEVA Historian. This value is of data type nvarchar(1500), with a default of NULL.

ActionTypeKey

The unique identifier for a particular type of action. Event tags and actions are linked by this key. The event subsystem relies on the following values, which are added during installation:

1 = No action

2 = Generic SQL

3 = Snapshot

4 = E-mail

5 = Deadband

6 = Summary

This value is of data type int, with a default of 0.

ActionString

The script that specifies the event action. Action scripts run on the local AVEVA Historian. This value is of data type nvarchar(1500), with a default of NULL.

Priority

The priority level for the action, either critical or normal. The priority level determines the sorting queue to which the action will be sent. The critical queue is used for highly important events. If a system overload condition occurs, events that are given a critical priority will always be processed first. Events that are given a normal priority will be processed after any critical events and may possibly be dropped (that is, not performed) on an overloaded system. This value is of data type tinyint, with a default of 0.

Edge

The "edge" for the event detection.

0 = Trailing

1 = Leading

2 = Both

3 = None

4 = Time Detector

5 = External Detector

This value is of data type tinyint, with a default of 1.

Permission

Execute permission defaults to the aaPowerUsers and aaAdministrators groups.

In This Topic
Related Links
TitleResults for “How to create a CRG?”Also Available in