In SQ L Database
In SQ L Database
Revision E
Last Revision: 7/13/05
Trademarks
All terms mentioned in this documentation that are known to be trademarks or
service marks have been appropriately capitalized. Invensys Systems, Inc.
cannot attest to the accuracy of this information. Use of a term in this
documentation should not be regarded as affecting the validity of any
trademark or service mark.
Alarm Logger, ActiveFactory, ArchestrA, Avantis, DBDump, DBLoad, DT
Analyst, FactoryFocus, FactoryOffice, FactorySuite, FactorySuite A2, InBatch,
InControl, IndustrialRAD, IndustrialSQL Server, InTouch, InTrack,
MaintenanceSuite, MuniSuite, QI Analyst, SCADAlarm, SCADASuite,
SuiteLink, SuiteVoyager, WindowMaker, WindowViewer, Wonderware, and
Wonderware Logger are trademarks of Invensys plc, its subsidiaries and
affiliates. All other brands may be trademarks of their respective owners.
Contents 3
Contents
Before You Begin ............................................. 11
About this Guide ...................................................................................11
IndustrialSQL Server Documentation Set.............................................11
Document Conventions ........................................................................ 12
CHAPTER 2: Tables..........................................21
Accessing Information About a Database Table .................................. 21
aaAreaData ........................................................................................... 21
aaAreaXML.......................................................................................... 22
aaAttributeData .................................................................................... 22
aaAttributeDataPending ....................................................................... 23
aaObjectData ........................................................................................ 23
aaObjectDataPending ........................................................................... 24
ActionType ........................................................................................... 24
AnalogSnapshot ................................................................................... 25
AnalogTag ............................................................................................ 25
Annotation............................................................................................ 27
BlobTag ................................................................................................ 28
CalcType............................................................................................... 28
ConfigStatusPending ............................................................................ 28
ConfigStatusSnapshot .......................................................................... 29
Context ................................................................................................. 29
DetectorType ........................................................................................ 30
Deviation .............................................................................................. 30
DiscreteSnapshot.................................................................................. 31
DiscreteTag........................................................................................... 32
EngineeringUnit ....................................................................................32
EnumeratedTag .....................................................................................33
EnumerationType ..................................................................................33
ErrorLog................................................................................................34
EventHistory .........................................................................................34
EventTag ...............................................................................................35
EventTagPendingDelete........................................................................37
Frequency..............................................................................................37
HistorianSysObjects..............................................................................38
History (INSQL.Runtime.dbo.History) ................................................38
HistoryBlock (INSQL.Runtime.dbo.HistoryBlock) .............................42
InTouchNode.........................................................................................43
InTouchSpecific ....................................................................................44
IODriver ................................................................................................45
IOServer ................................................................................................47
IOServerType ........................................................................................48
Limit......................................................................................................49
LimitName ............................................................................................50
Live (INSQL.Runtime.dbo.Live)..........................................................50
LocalizedText........................................................................................51
Message.................................................................................................52
ModLogColumn....................................................................................52
ModLogTable........................................................................................53
OPCQualityMap....................................................................................54
PrivateGroupTag ...................................................................................54
PrivateNameSpace ................................................................................54
PublicGroupTag ....................................................................................55
PublicNameSpace .................................................................................56
QualityMap ...........................................................................................56
RateOfChange.......................................................................................57
ServerList ..............................................................................................57
SnapshotDetail ......................................................................................58
SnapshotTag ..........................................................................................58
SQLTemplate.........................................................................................59
StateWideHistory (INSQL.Runtime.dbo.StateWideHistory)................59
StorageLocation ....................................................................................62
StorageNode..........................................................................................63
StringSnapshot ......................................................................................65
StringTag ...............................................................................................65
SummaryData........................................................................................66
SummaryHistory ...................................................................................66
SummaryOperation ...............................................................................67
SummaryTagList ...................................................................................68
SystemParameter.................................................................................. 69
Tag ........................................................................................................ 69
TagRef .................................................................................................. 73
TimeDetectorDetail .............................................................................. 73
TimeDetectorDetailPendingDelete ...................................................... 74
TimeZone ............................................................................................. 74
Topic..................................................................................................... 75
TopicImportInfo ................................................................................... 76
UserDetail............................................................................................. 77
WideHistory (INSQL.Runtime.dbo.WideHistory)............................... 77
CHAPTER 3: Views...........................................83
History Table Views ............................................................................. 83
v_EventSnapshot.................................................................................. 84
v_EventStringSnapshot ........................................................................ 84
v_ModTracking .................................................................................... 85
v_SnapshotData.................................................................................... 86
v_SummaryData................................................................................... 87
aaDeleteTag .....................................................................................104
aaDetectorStringSelect ....................................................................105
aaDiscreteTagDelete........................................................................105
aaDiscreteTagInsert .........................................................................105
aaDiscreteTagSelect ........................................................................108
aaDiscreteTagUpdate.......................................................................108
aaEngineeringUnitDelete ................................................................109
aaEngineeringUnitInsert..................................................................109
aaEngineeringUnitSelect .................................................................110
aaEngineeringUnitUpdate ............................................................... 111
aaEventDetection.............................................................................111
aaEventHistoryInsert .......................................................................112
aaEventHistorySelect ......................................................................113
aaEventSnapshotInsert ....................................................................113
aaEventSnapshotSelect....................................................................114
aaEventTagDelete............................................................................114
aaEventTagDetail ............................................................................115
aaEventTagInsert .............................................................................115
aaEventTagSelect ............................................................................118
aaEventTagSelectAll .......................................................................118
aaEventTagSelectDeleted ................................................................118
aaEventTagSelectDisabled ..............................................................119
aaEventTagSelectInserted................................................................119
aaEventTagSelectUpdated ...............................................................119
aaEventTagUpdate...........................................................................119
aaGetDbRevision.............................................................................120
aaGetLastTagKey ............................................................................120
aaHistorianConfigNSExpand ..........................................................121
aaHistorianNSExpand .....................................................................121
aaHistorianStatusSelect ...................................................................121
aaHistorianStatusSet........................................................................122
aaHistoryBlockSelect ......................................................................123
aaInTouchNodeTagList ...................................................................123
aaIODriverDelete ............................................................................124
aaIODriverInsert..............................................................................124
aaIODriverSelect .............................................................................126
aaIODriverUpdate ...........................................................................126
aaIOServerDelete ............................................................................127
aaIOServerInsert..............................................................................127
aaIOServerSelect .............................................................................129
aaIOServerTypeDelete ....................................................................129
aaIOServerTypeInsert......................................................................130
aaIOServerTypeSelect .....................................................................130
aaIOServerTypeUpdate ...................................................................131
aaIOServerUpdate ...........................................................................131
aaLimitDelete ..................................................................................132
aaLimitInsert....................................................................................132
aaLimitNameDelete.........................................................................133
aaLimitNameInsert ..........................................................................133
aaSystemConfigNSExpand .............................................................162
aaSystemNSExpand ........................................................................162
aaSystemNSExpand2 ......................................................................163
aaSystemParameterSelect................................................................163
aaSystemParameterUpdate ..............................................................164
aaTagConfig ....................................................................................164
aaTagConfigModified......................................................................164
aaTagConfigSelect...........................................................................165
aaTagInfo .........................................................................................165
aaTagType........................................................................................166
aaTimeDetectorDetailInsert.............................................................166
aaTimeDetectorDetailSelect............................................................167
aaTimeDetectorDetailUpdate ..........................................................167
aaTopicDelete ..................................................................................168
aaTopicInsert ...................................................................................168
aaTopicSelect...................................................................................169
aaTopicUpdate.................................................................................170
aaUpdateCalculatedAISamples .......................................................170
aaUserAccessLevelSelect................................................................171
aaUserDetailUpdate.........................................................................171
Extended Stored Procedures ...............................................................171
History Extended Stored Procedures...............................................172
Utility Extended Stored Procedures ................................................173
Extended Stored Procedure Arguments...........................................176
System Extended Stored Procedures ...............................................178
Stored Procedures for Internal Use .....................................................180
Creating Stored Procedures.................................................................181
Index................................................................215
Document Conventions
This documentation uses the following conventions:
C H A P T E R 1
Table Categories
There are eight table categories within the IndustrialSQL Server historian
Runtime database. Tables in a category together facilitate a particular
functionality in the historian.
Note Additional tables and views are provided for backward compatibility
support. For more information, see Chapter 6, "Backward Compatibility
Entities."
Contents
• History Tables
• Event Tables
• InTouch Integration Tables
• Modification Tracking Tables
• Namespaces and Grouping Tables
• Tag Definition Tables
• System Configuration Tables
• ArchestrA Browsing Tables
History Tables
Because normal Microsoft® SQL Server™ functionality cannot handle the
storage and retrieval of huge quantities of rapidly changing data, plant data
storage and retrieval are made possible by the IndustrialSQL Server storage
subsystem, the history tables, and the retrieval system.
Some of the history tables are implemented as normal SQL Server tables, and
the information contained in them is stored in the Runtime database file
(Run90Dat.mdf). Others are implemented as a special type of table called a
remote table, or extension table. Extension tables do not actually exist in the
database, but rather expose data that is stored in special history files (history
blocks) on disk via OLE DB technology.
For more information, see Chapter 6, "Data Retrieval Subsystem," in your
IndustrialSQL Server™ Historian Concepts Guide.
Acquired tag data can be presented in the history tables in three different
formats: a normal historical format, a "wide" format, and a "live" format.
Information about the history blocks is stored in the special HistoryBlock
extension table.
To make querying from the history tables easier, views have been provided.
Instead of specifying the table name using the required four-part syntax
(INSQL.Runtime.dbo.<tablename>), you can simply use the view name
instead. The history tables and associated views are listed in the following
table. (Backward compatibility tables and views are not included.)
The History and Live tables can accommodate a mixture of tag types and
should be used for all queries. The vValue column returns a sql_variant for all
tag types. The Value column returns a float value for analog and discrete tags
and a NULL for string tags. The Value column is included to allow for
aggregation and other operations that are not permitted on a sql_variant
column.
You can relate these tables to other tables in the IndustrialSQL Server historian
database.
For more information on each of these tables, see the corresponding table
description in this documentation.
The history tables that are listed in SQL Server Enterprise Manager under the
Tables tree item for the Runtime database (for example, History_OLEDB) are
simply definitions for the OLE DB provider to use; no data is stored in them.
The extension tables that actually provide data to clients are listed for the
INSQL or INSQLD linked servers under the Security tree item.
02:17:01:03 78 79 77 80
02:17:01:04 77 78 76 79
02:17:01:05 77 78 76 79
Using the History table to perform the same task is much more difficult.
You can also specify search criteria for the values you want to return (for
example, where Temp1 > 75). The WideHistory table can only be related to
other tables based on the timestamp.
The WideHistory table column type returns a SQL Server type float for analog,
a SQL Server type int for discrete tags, and an nvarchar(512) for string tags.
The schema of the definition table, WideHistory_OLEDB, indicates a
sql_variant type. This is simply a shorthand notation; it does not represent the
type actually returned.
There is no Quality column for the WideHistory table because there is more
than one tag value for each row returned. However, a value returned for a
specified tag will be set to NULL if the quality of the value is invalid,
inhibited, or unavailable.
The following restrictions apply when performing a query against the
WideHistory table:
• Column names must be specified.
• The table is only accessible via the OPENQUERY statement.
Because tagnames are used for column names, the tagname can include any
characters as defined by the rules for Microsoft SQL Server identifiers. An
identifier that does not comply with the rules for the format of regular
identifiers must always be delimited using brackets ( [ ] ). For more
information on identifiers and delimiters, see your Microsoft SQL Server
documentation.
If you include an illegal column name in your query and do not use delimiters,
no data will be returned.
The StateWideHistory table is similar to the WideHistory table, except that it
allows for retrieval of calculated "time in state" values for multiple tags,
instead of actual history values. This table includes a Value and a vValue
column, and the tag columns contain the time in state for the corresponding
value. For more information on this table, see "StateWideHistory
(INSQL.Runtime.dbo.StateWideHistory)" on page 59. For information on how
to query this table, see "Time-in-State Retrieval Mode" on page 137 in your
IndustrialSQL Server™ Historian Concepts Guide.
Note The AnalogLive, DiscreteLive, and StringLive tables are provided for
backward compatibility and can only accept tagnames in the SELECT
statement that are of the same type; that is, you can't mix the tag types in the
query. The Live table, however, can accommodate a mixture of tag types and
should be used instead of the AnalogLive, DiscreteLive, or StringLive tables.
Event Tables
Event tables contain definitions for events, including tags associated with
events, detectors for events, and actions for events. The event system tables
can also store "snapshots" of tag values at the time of an event, as well as
details about the event itself.
A special type of event action is a summarization of tag values. A subset of the
event tables provide the supporting framework for fully automated summary
generation for analog, discrete and string tags. The event system tables are:
ActionType AnalogSnapshot
CalcType DetectorType
DiscreteSnapshot EventHistory
EventTag EventTagPendingDelete*
Frequency SnapshotTag
SQLTemplate StringSnapshot
SummaryData SummaryHistory
SummaryOperation SummaryTagList
Tag TimeDetectorDetail
TimeDetectorDetailPendingDelete*
C H A P T E R 2
Tables
Note Tables that have been retained for backward compatibility are listed in
Chapter 6, "Backward Compatibility Entities."
Contents
• Accessing Information About a Database Table
aaAreaData
Contains one row for each item in the latest ArchestrA Area data package.
The Area data hierarchy is sent from ArchestrA to the historian in the form of
an XML data package. In addition to data about the Areas, this package also
contains data about the Galaxy, WinPlatforms, AppEngines, and
DeviceIntegration Objects.
aaAreaXML
Contains a single row describing the latest Area data sent from ArchestrA.
aaAttributeData
Contains one row for each attribute referenced by an object in the ArchestrA
namespace.
aaAttributeDataPending
Contains one row for each attribute in the latest ArchestrA attribute data
package.
aaObjectData
Contains one row for each object in the ArchestrA namespace.
aaObjectDataPending
Contains one row for each object in the latest ArchestrA object data package.
ActionType
Contains one row for each type of event action.
AnalogSnapshot
Contains one row for each analog tag value that was configured to be stored
when a defined event occurred. To view analog, discrete, and string snapshot
values at the same time, use the v_SnapshotData view instead. For more
information, see "v_SnapshotData" on page 86.
AnalogTag
Contains one row for each defined analog tag. Configuration information
specific to analog tags is stored in this table, while general information for all
tag types is stored in the Tag table.
Annotation
Contains one row for each user annotation about a tag value. Users can make
personal (or public) notes about a tag value, and this information is stored
along with the tag value and timestamp to which the annotation applies. Each
annotation in this table is linked to a database user.
BlobTag
Reserved for future use. Do not use this table. Contains one row for each
defined blob tag.
CalcType
Contains one row for each type of summary calculation that can be performed
by the event subsystem.
ConfigStatusPending
Contains one row for each database modification that requires a re-
initialization of the system.
ConfigStatusSnapshot
When changes to the historian system are committed, a snapshot of the content
of the ConfigStatusPending table is stored to this table. The internal
configuration object then finishes processing the reinitialization based on the
data in this table, while any new changes are being stored in the
ConfigStatusPending table.
The columns in this table are identical to the columns in the
ConfigStatusPending table.
Context
Contains one row for each context to which a group of limits, rates of change,
or deviations can belong. Example contexts are "Normal Operation" and "Cold
Shutdown."
DetectorType
Contains one row for each type of event detector.
Deviation
Contains one row for each defined deviation for an analog tag. The deviation is
the percentage of change in a tag's value from a fixed value, called the target.
Each analog tag can have two defined deviations: major and minor. This table
is populated when an InTouch application is imported and is not used by the
IndustrialSQL Server historian.
DiscreteSnapshot
Contains one row for each discrete tag value that was configured to be stored
when a defined event occurred. To view analog, discrete, and string snapshot
values at the same time, use the v_SnapshotData view instead. For more
information, see "v_SnapshotData" on page 86.
DiscreteTag
Contains one row for each defined discrete tag. Configuration information
specific to discrete tags is stored in this table, while general information for all
tag types is stored in the Tag table.
EngineeringUnit
Contains one row for each defined engineering unit (unit of measure).
EnumeratedTag
Reserved for future use. Do not use this table. Contains one row for each
defined enumerated tag.
EnumerationType
Reserved for future use. Do not use this table. Contains one row for each
defined enumeration type.
ErrorLog
Contains one row for each system message (or error message). Typically, this
table is not used. The actual message text is stored in the LocalizedText table,
and can be retrieved by specifying the error code in the SQL query. Or, you can
use the v_ErrorLog view to retrieve the data included in this table, plus the
actual text.
EventHistory
Contains one row for each stored event, as labeled by the tagname. Event data
must be configured to be logged into this table.
EventTag
Contains one row for each event definition. Configuration information specific
to event tags is stored in this table, while general information for all tag types is
stored in the Tag table.
EventTagPendingDelete
Contains one row for each event tag that is pending deletion. This table is used
internally by the system during the deletion process. The columns in this table
are the same as in the EventTag table.
Frequency
Contains one row for each available frequency for summary operations.
HistorianSysObjects
Contains one row for each object in the database for which changes can be
tracked.
History (INSQL.Runtime.dbo.History)
Contains one row for each stored tag value.
HistoryBlock
(INSQL.Runtime.dbo.HistoryBlock)
Contains one row for each block of history data stored on a storage node.
InTouchNode
Contains one row for each InTouch node from which a tagname data dictionary
(Tagname.x) is imported into the IndustrialSQL Server historian.
InTouchSpecific
Contains one row of import-related information for each data dictionary
(Tagname.x) imported from InTouch HMI software.
IODriver
Contains one row for each IDAS providing data to the IndustrialSQL Server
historian.
IOServer
Contains one row for each I/O Server providing data to the IndustrialSQL
Server historian.
IOServerType
Contains one row for every known I/O Server type. Information about a new I/
O Server is added to this table when the server is installed. This table is
populated with the latest information about Wonderware I/O Servers at the
time of shipping.
Limit
Contains one row for each monitored limit for a specified tag. A limit can be
associated with one or more tags and/or contexts.
LimitName
Contains one row for each name that is associated with a defined limit.
Examples are "high," "low," and "maintenance."
Live (INSQL.Runtime.dbo.Live)
Contains one row for each analog, discrete, or string tag. The value of each tag
in this table is updated every time a new value is received.
LocalizedText
Contains one row for each string of text that can be returned to a client from
the IndustrialSQL Server historian (for example, error messages and status
messages).
Note If you add new text to the LocalizedText table, you must stop and restart
the IndustrialSQL Server historian in order for the changes to go into effect.
Message
Contains one row for each on/off message pair that can be associated with a
discrete tag. For example, a message pair may be "Open" and "Closed" and
could be associated with valve and switch positions.
ModLogColumn
Contains one row for each database column on which an INSERT, UPDATE,
or DELETE has been performed.
ModLogTable
Contains one row for each database table on which an INSERT, UPDATE, or
DELETE has been performed.
OPCQualityMap
Contains one row for each defined OPC quality.
PrivateGroupTag
Contains one row for each instance of a tag in a user's private namespace.
PrivateNameSpace
Contains one row for each object in the private namespace. Objects in the
private namespace can include plant machines, areas, tags, and so on, and are
organized in a hierarchy. Allows for more than one name to map to a single tag.
PublicGroupTag
Contains one row for each instance of a tag in the public namespace.
PublicNameSpace
Contains one row for each object in the public namespace. Objects in the
public namespace can include plant machines, areas, and so on, and are
organized in a hierarchy. Allows more than one name to map to a single tag.
QualityMap
Contains one row for every permutation of quality detail for a tag value.
RateOfChange
Contains one row for each monitored rate of change for a tag.
ServerList
Contains one row for each server used in an enterprise system. Allows for the
creation of the system namespace, which contains a list of servers, and a flat
namespace of tags per server.
SnapshotDetail
Contains one row for each storage size configuration for tags. This table is
used by the storage subsystem to manage the snapshot files.
SnapshotTag
Contains one row for each tag that is included in the snapshot action associated
with a given event tag.
SQLTemplate
Contains one row for each pre-defined SQL script, which can be copied and
used as a basis for an event detection or action script.
StateWideHistory
(INSQL.Runtime.dbo.StateWideHistory)
Contains one row for the amount of time one or more analog, discrete, or string
tags have been in a particular state, thus providing a "wide" view of the data.
StorageLocation
Contains one row for each defined storage location on a specific storage node.
StorageNode
Contains one row for each defined storage node.
StringSnapshot
Contains one row for each string tag value that was configured to be stored
when a defined event occurred. To view analog, discrete, and string snapshot
values at the same time, use the v_SnapshotData view instead. For more
information, see "v_SnapshotData" on page 86.
StringTag
Contains one row for each defined string tag. Configuration information
specific to string tags is stored in this table, while general information for all
tag types is stored in the Tag table.
SummaryData
Contains one row for each summarized value, or result, for a tag. The Quality
column contains the highest quality value of the raw data from which the result
is calculated.
SummaryHistory
Contains one row for each occurrence of a summary operation. Rows are
inserted even if the operation did not return data.
SummaryOperation
Contains one row for each defined summary operation that is associated with
the event tag specified in the TagName column.
SummaryTagList
Contains one row for each combination of a summarized tag and a specific
summary operation. This table is a linking table that allows tags to be
associated with a type of operation.
SystemParameter
Contains one row for each system parameter.
Tag
Contains one row for each tag in the system and includes the basic definition
for the tag, such as the I/O Server that supplies the values.
TagRef
Contains one row for each tag in the system. This table is used as a reference
table for the Tag table, so that the TagName column is not propagated as the
primary key of child tables.
TimeDetectorDetail
Contains a least one row for each event tag associated with a time detector.
TimeDetectorDetailPendingDelete
Contains one row for each time detector that is pending deletion. This table is
used internally by the system during the deletion process.
The columns in this table are the same as in the TimeDetectorDetail table.
TimeZone
Contains one row for each time zone as defined by the Windows® operating
system. This table is automatically populated by the system.
Topic
Contains one row for each topic to be read from an I/O Server.
TopicImportInfo
Contains one row for each topic definition imported from an InTouch node.
UserDetail
Contains one row for each IndustrialSQL Server historian user. Used to store
additional user information that is not stored in the Microsoft SQL Server
Runtime.sysusers table. Applicable for both users and groups of users.
When the IndustrialSQL Server historian is installed, a SQL job is created on
the Microsoft SQL Server that will automatically update this table every hour.
In order for this job to be executed, however, the SQL Server Agent must be
running. For more information about jobs, see your Microsoft Online Books.
WideHistory (INSQL.Runtime.dbo.WideHistory)
Contains one row of values for multiple analog, discrete, or string tags for a
single timestamp, thus providing a "wide" view of the data.
Because tagnames are used as column names for the returned data (indicated
by Tag1, Tag2, and ManyOtherTags), the value data types will be of the
appropriate type for associated tags
C H A P T E R 3
Views
A view is a logical way of looking at data from one or more tables in the
database. A view is a "virtual" table; that is, it does not actually exist in the
database. A view contains pointers to the actual tables in the database. Views
can be used to include a subset of information stored in one or more tables,
while leaving out other information. Views are part of normal SQL Server
functionality.
To make it easier to query data from some of the IndustrialSQL Server
historian tables, a number of views onto the data are provided. Queries are
performed on these views as if they were normal physical tables.
Contents
• History Table Views
• v_EventSnapshot
• v_EventStringSnapshot
• v_ModTracking
• v_SnapshotData
• v_SummaryData
v_EventSnapshot
Returns one row for each snapshot value for an analog and/or discrete tag
(specified by the TagName column) associated with a particular snapshot event
(specified by the Event column).
Note When an event is not linked to a snapshot action, the TagName column
is set to '-' and the Value, Quality, and QualityDetail columns are set to
NULL.
v_EventStringSnapshot
Returns one row for each snapshot value for a string tag (specified by the
TagName column) associated with a particular snapshot event (specified by the
Event column).
v_ModTracking
Returns one row for each database modification made. For more information,
see "Viewing Database Modifications" on page 183 in your IndustrialSQL
Server™ Historian Administration Guide.
v_SnapshotData
Returns one row for each snapshot value for an analog, discrete, and/or string
tag (specified by the TagName column) associated with a particular snapshot
event (specified by the Event column).
v_SummaryData
Returns one row for each summarization of a tag (specified by the TagName
column) for an associated summary event tag (specified by the EventTag
column). The resolution is applied to data before the calculation is performed.
The quality value returned is the highest quality value of the raw data from
which the result is calculated. For more information, see "Summary Actions"
on page 202 in your IndustrialSQL Server™ Historian Concepts Guide.
C H A P T E R 4
Stored Procedures
Contents
• Stored Procedures
• Extended Stored Procedures
• Stored Procedures for Internal Use
• Creating Stored Procedures
Stored Procedures
Some stored procedures are useful when performing database queries to return
information about specific tags in the system. These stored procedures allow
you to return information on a tag's definition or to narrow the scope of a query
on a data storage table. You can use these stored procedures when querying the
database using ad-hoc query tools, such as SQL Server Query Analyzer.
Other stored procedures are used to configure the IndustrialSQL Server
historian. These system stored procedures are normally executed during startup
and during changes to the system configuration. These stored procedures are
used mainly by the historian setup program, the event subsystem, the System
Management Console, and client applications.
Note Stored procedures prefixed with "ww_" are provided only for backward
compatibility. For more information, see "Renamed Stored Procedures" on
page 209.
aaActionStringSelect
Selects the action string for a specified event tag.
Syntax
aaActionStringSelect TagName
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaDetectorStringSelect
aaAddTag
Inserts a tag into the database.
Syntax
aaAddTag wTagName, wTopicKey, wIOServerKey,
wStorageNodeKey, wDescription, wAcquisitionType,
wStorageType, wAcquisitionRate, wStorageRate,
wItemName, wTagType, wTimeDeadband, wCurrentEditor
Arguments
wTagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
wTopicKey
The unique numerical identifier for the topic. This value is of data type int,
with no default.
wIOServerKey
The unique numerical identifier for the I/O Server. This value is of data
type int, with no default.
wStorageNodeKey
The unique numerical identifier for the storage node. This value is of data
type int, with no default.
wDescription
The description of the tag. This value is of data type nvarchar(512), with
no default.
wAcquisitionType
The method by which the tag's value is acquired. If the tag value is
acquired from an I/O Server, specify the name of the I/O Server, topic, and
item. 0 = Not acquired; 1 = Acquired via an I/O Server; 2 = Acquired via
MDAS or a manual update; 3 = System driver. This value is of data type
tinyint, with no default.
wStorageType
The type of storage defined for the tag. 0 = Not stored; 1 = Cyclic; 2 =
Delta; 3 = Forced storage; 17 = The storage type has been changed from
cyclic to "not stored." 18 = The storage type has been changed from delta
to "not stored." 19 = The storage type has been changed from "forced" to
"not stored." This value is of data type smallint, with no default.
wAcquisitionRate
For polled tags of AcquisitionType 1, the poll rate in milliseconds.
Reserved for future use. This value is of data type int, with no default.
wStorageRate
The rate at which the tag is stored if the storage type is cyclic. This value
is of data type int, with no default.
wItemName
The address string of the tag. This value is of data type nvarchar(256),
with no default.
wTagType
The type of tag. 1 = Analog; 2 = Discrete; 3 = String; 4 = Complex; 5 =
Event. This value is of data type int, with no default.
wTimeDeadband
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 no default.
wCurrentEditor
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 InSQL. 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 Industrial Application
Server (IAS) use IAS as the current editor. If you modify an IAS tag using
the historian Configuration Editor, then the current editor for the tag is
changed to InSQL. However, the next time you redeploy the engine, the
changes are not preserved. 0 = IndustrialSQL Server; 1 = InTouch; 2 =
Application other than IndustrialSQL Server or InTouch. This value is of
data type int, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaDeleteTag
aaAnalogTagDelete
Deletes an analog tag.
Syntax
aaAnalogTagDelete wwTagKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaAnalogTagInsert
aaAnalogTagSelect
aaAnalogTagUpdate
aaAnalogTagInsert
Inserts an analog tag.
Syntax
aaAnalogTagInsert TagName, Description, AcquisitionType,
StorageType, StorageRate, ItemName, TimeDeadband,
CreatedBy, DateCreated, CurrentEditor, EUKey, MinEU,
MaxEU, MinRaw, MaxRaw, Scaling, RawType, ValueDeadband,
InitialValue, IntegerSize, SignedInteger, TopicKey,
IOServerKey, StorageNodeKey, AIRetrievalMode,
SamplesInActiveImage, RateDeadband, InterpolationType,
RolloverValue, ServerTimeStamp, DeadbandType
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server 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.
AcquisitionType
The method by which the tag's value is acquired. If the tag value is
acquired from an I/O Server, specify the name of the I/O Server, topic, and
item. 0 = Not acquired; 1 = Acquired via an I/O Server; 2 = Acquired via
MDAS or a manual update; 3 = System driver. This value is of data type
tinyint, with a default of 1.
StorageType
The type of storage defined for the tag. 0 = Not stored; 1 = Cyclic; 2 =
Delta; 3 = Forced storage; 17 = The storage type has been changed from
cyclic to "not stored." 18 = The storage type has been changed from delta
to "not stored." 19 = The storage type has been changed from "forced" to
"not stored." This value is of data type smallint, with a default of 2.
StorageRate
The rate at which the tag is stored if the storage type is cyclic. The rate is
in milliseconds. This value is of data type int, with a default of 10000.
ItemName
The address string of the tag. This value is of data type nvarchar(256),
with a default of an empty string.
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.
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 datetime, 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 InSQL. 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 Industrial Application
Server (IAS) use IAS as the current editor. If you modify an IAS tag using
the historian Configuration Editor, then the current editor for the tag is
changed to InSQL. However, the next time you redeploy the engine, the
changes are not preserved. 0 = IndustrialSQL Server; 1 = InTouch; 2 =
Application other than IndustrialSQL Server or InTouch. This value is of
data type int, with a default of 0.
EUKey
The unique numerical identifier for the engineering unit. This value is of
data type int, with a default of 1.
MinEU
The minimum value of the tag, measured in engineering units. This value
is of data type float(25), with a default of 0.
MaxEU
The maximum value of the tag, measured in engineering units. This value
is of data type float(25), with a default of 100.
MinRaw
The minimum value of the raw acquired value. This value is of data type
float(25), with a default of 0.
MaxRaw
The maximum value of the raw acquired value. This value is of data type
float(25), with a default of 4095.
Scaling
The type of algorithm used when scaling from raw values to engineering
units. For linear scaling, the result is calculated using linear interpolation
between the end points. 0 = None; 1 = Linear; 2 = Square Root. (Square
root is reserved for future use). This value is of data type int, with a default
of 1.
RawType
The numeric type for the raw value. 1 = Euro Float, an outdated data type
(4 bytes); 2 = MS Float (4 bytes); 3 = Integer (2 or 4 bytes); 4 = MS
Double (reserved for future use) (8 bytes). This value is of data type int,
with a default of 3.
ValueDeadband
The percentage of the difference between the minimum and maximum
engineering units for the tag. Any data values that change less than the
specified deadband are not stored. The value deadband applies to delta
storage only. A value of 0 indicates that a value deadband will not be
applied. This value is of data type float(25), with a default of 0.
InitialValue
The initial value as imported from an external source (for example, from
InTouch). This value is of data type float(25), with a default of 0.
IntegerSize
The bit size of the analog tag. 12 = 12-bit; 15 = 15-bit; 16 = 16-bit; 32 =
32-bit; 64 = 64-bit (future implementation). This value is of data type
tinyint, with a default of 16.
SignedInteger
Used to specify whether an integer is a signed number (positive or
negative) or an unsigned number (positive only). 0 = Unsigned; 1 =
Signed. This value is of data type bit, with a default of 0.
TopicKey
The unique numerical identifier for the topic. This value is of data type int,
with a default of NULL.
IOServerKey
The unique numerical identifier for the I/O Server. This value is of data
type int, with a default of NULL.
StorageNodeKey
The unique numerical identifier for the storage node. This value is of data
type int, with a default of 1.
AIRetrievalMode
Used to specify the behavior of retrieval for data in active image. You can
either retrieve from all acquired data values that are currently in the active
image, or only the data values that are configured to be stored on disk.
Data on disk may be a subset of that in the active image, depending on the
storage rate for the tag.Valid values are: 0 = All of the values received into
the active image will be included in the returned data (default); 1 = Only
the values that will be moved into storage will be included in the returned
data. This value is of data type tinyint, with a default of 0.
SamplesInActiveImage
The number of samples that the active image holds for the tag. 0 indicates
that the active image is using the default of 65 values. The higher the
number of samples, the higher the load on memory resources. This value
is of data type int, with a default of 0.
RateDeadband
Used to percentage of deviation in the full-scale value range for an analog
tag. The swinging door (rate) deadband applies to delta storage only. Time
and/or value deadbands can be used in addition to the swinging door
deadband. Any value greater than 0 can be used for the deadband. A value
of 0 indicates that a swinging door deadband will not be applied. This
value is of data type float(25), with a default of 0.
InterpolationType
The interpolation type for retrieval. 0 = Stair-stepped interpolation; 1 =
Linear interpolation (if applicable, based on the tag type); 254 = System
default interpolation mode. The system default interpolation type is to use
the system default for the analog type, either integer or real. The system
default interpolation type for an analog type is determined by the setting of
the InterpolationTypeInteger and InterpolationTypeReal system
parameters. This setting impacts Interpolated, Average, and Integral
retrieval modes. This value is of data type tinyint, with a default of 254.
RolloverValue
The first value that causes the counter to "roll over." This rollover value is
used for the "counter" retrieval mode. For example, for a counter that
counts from 0 to 9999, the counter rolls over back to 0 for the 10,000th
value it receives. Therefore, set the rollover value to 10,000. This value is
of data type int, with a default of 0.
ServerTimeStamp
Used to specify whether local timestamping by the IndustrialSQL Server
is used. 0 = The IDAS timestamp is used; 1 = The IndustrialSQL Server
time is used for the timestamp. If a fast-changing tag is configured to use
server timestamping, the packet of data that is sent to the storage
subsystem may contain multiple data values with the same timestamp,
which may affect data calculations, such as for swinging door storage.
This value is of data type bit, with a default of 0.
DeadbandType
The type of delta storage deadband to be applied for the tag. This setting is
only in effect if delta storage is configured for the tag. 1= Time and/or
value deadband; 2 = Rate (swinging door) deadband. This value is of data
type smallint, with a default of 1.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaAnalogTagSelect
aaAnalogTagDelete
aaAnalogTagUpdate
aaAnalogTagSelect
Selects an analog tag.
Syntax
aaAnalogTagSelect wwTagKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaAnalogTagInsert
aaAnalogTagDelete
aaAnalogTagUpdate
aaAnalogTagUpdate
Updates an analog tag.
Syntax
aaAnalogTagUpdate wwTagKey, TagName, Description,
AcquisitionType, StorageType, StorageRate, ItemName,
TimeDeadband, CreatedBy, DateCreated, CurrentEditor,
EUKey, MinEU, MaxEU, MinRaw, MaxRaw, Scaling, RawType,
ValueDeadband, InitialValue, IntegerSize,
SignedInteger, TopicKey, IOServerKey, StorageNodeKey,
AIRetrievalMode, SamplesInActiveImage, RateDeadband,
InterpolationType, RolloverValue, ServerTimeStamp,
DeadbandType
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
aaAnnotationDelete
Deletes an annotation.
Syntax
aaAnnotationDelete AnnotationKey
Arguments
AnnotationKey
The unique numerical identifier for the annotation. This value is of data
type int, with no default.
Permission
Execute permission defaults to the aaUsers, aaPowerUsers, and
aaAdministrators groups.
See Also
aaAnnotationSelect
aaAnnotationUpdate
aaAnnotationInsert
aaAnnotationRetrieve
aaAnnotationInsert
Inserts an annotation.
Syntax
aaAnnotationInsert TagName, UserKey, DateTime,
DateCreated, Content, Value
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system. This
value is of data type nvarchar(256), with no default.
UserKey
The unique numerical identifier for a database user as defined in the
UserDetail table. This value is of data type int, with a default of NULL.
DateTime
The timestamp of the tag value for which the user has made an annotation.
This value is of data type datetime, with a default of NULL.
DateCreated
The date that the annotation was created. This value is of data type
datetime, with a default of NULL.
Content
The annotation text. This value is of data type ntext, with a default of
"Annotation."
Value
The value of the tag at the time of the annotation. This value is of data type
real, with a default of 0.0.
Permission
Execute permission defaults to the aaUsers, aaPowerUsers, and
aaAdministrators groups.
See Also
aaAnnotationSelect
aaAnnotationUpdate
aaAnnotationDelete
aaAnnotationRetrieve
aaAnnotationRetrieve
Retrieves one or more annotations.
Syntax
aaAnnotationRetrieve TagList, StartTime, EndTime
Arguments
TagList
A list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with no default.
StartTime
The starting timestamp for the data to query. This value is of data type
nvarchar(50), with no default.
EndTime
The ending timestamp for the data to query. This value is of data type
nvarchar(50), with no default.
Permission
Execute permission defaults to the public group.
See Also
aaAnnotationInsert
aaAnnotationUpdate
aaAnnotationDelete
aaAnnotationSelect
aaAnnotationSelect
Selects an annotation.
Syntax
aaAnnotationSelect AnnotationKey
Arguments
AnnotationKey
The unique numerical identifier for the annotation. This value is of data
type int, with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaAnnotationInsert
aaAnnotationUpdate
aaAnnotationDelete
aaAnnotationRetrieve
aaAnnotationUpdate
Updates an annotation.
Syntax
aaAnnotationUpdate AnnotationKey, TagName, UserKey,
DateTime, DateCreated, Content, Value
Arguments
AnnotationKey
The unique numerical identifier for the annotation. This value is of data
type int, with no default.
The remaining arguments are similar to those for the aaAnnotationInsert
stored procedure.
Permission
Execute permission defaults to the aaUsers, aaPowerUsers, and
aaAdministrators groups.
See Also
aaAnnotationSelect
aaAnnotationInsert
aaAnnotationDelete
aaAnnotationRetrieve
aaArchestrANSClear
Removes all ArchestrA entries from the public namespace.
Syntax
aaArchestrANSClear
Remarks
In general, using this stored procedure is not recommended. If you need to
remove the ArchestrA entries because of a namespace corruption, contact
Technical Support for guidance.
Permission
Execute permission defaults to the aaAdministrators group.
aaCleanupAfterCommit
Runs once after re-initialization or system startup is complete.
Syntax
aaCleanupAfterCommit
Remarks
This stored procedure:
1. Sets the DbStatus column of the StorageNode table to 0.
2. Deletes the contents of the ConfigStatusSnapshot table.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaCommitChanges
aaCleanupSystemNotRunning
Runs once whether or not re-initialization or system startup is complete. For
internal use only.
Syntax
aaCleanupSystemNotRunning
Remarks
This stored procedure:
1. Sets the DbStatus column of the StorageNode table to 0.
2. Deletes information from the ConfigStatusSnapshot table.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaCleanupAfterCommit
aaCommitChangesAtStartup
aaCommitChanges
aaCommitChanges
Used to trigger a re-initialization of the system.
Syntax
aaCommitChanges
Remarks
This stored procedure performs the following if a change is made:
1. Copies the contents of the ConfigStatusPending table to the
ConfigStatusSnapshot table.
2. Resets the Status column in the applicable database table (Tag, Topic,
IOServer, IODriver, StorageLocation, SnapshotDetail, or
SystemParameter) to 0.
3. Deletes the contents of the ConfigStatusPending table.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaCleanupAfterCommit
aaCommitChangesAtStartup
aaCommitChangesAtStartup
Used to specify a re-initialization of the system at startup.
Syntax
aaCommitChangesAtStartup
Remarks
This stored procedure is used only when a modification to a storage location
has been made. The functionality of this stored procedure is similar to that of
aaCommitChanges.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaCommitChanges
aaContextDelete
Deletes a context.
Syntax
aaContextDelete ContextKey
Arguments
ContextKey
The unique numerical identifier for the context. This value is of data type
int, with no default.
Permission
Execute permission defaults to the aaPowerUsers, and aaAdministrators
groups.
See Also
aaContextSelect
aaContextUpdate
aaContextInsert
aaContextInsert
Inserts a context.
Syntax
aaContextInsert Description
Arguments
Description
The description of the context. This value is of data type nvarchar(50),
with a default of NULL.
Permission
Execute permission defaults to the aaPowerUsers, and aaAdministrators
groups.
See Also
aaContextSelect
aaContextUpdate
aaContextDelete
aaContextSelect
Selects a context.
Syntax
aaContextSelect ContextKey
Arguments
ContextKey
The unique numerical identifier for the context. This value is of data type
int, with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaContextInsert
aaContextUpdate
aaContextDelete
aaContextUpdate
Updates a context.
Syntax
aaContextUpdate ContextKey, Description
Arguments
ContextKey
The unique numerical identifier for the context. This value is of data type
int, with no default.
The remaining argument is the same as for the aaContextInsert stored
procedure. However, the argument does not have a default.
Permission
Execute permission defaults to the aaPowerUsers, and aaAdministrators
groups.
See Also
aaContextInsert
aaContextSelect
aaContextDelete
aaDBChangesPending
Returns a list of modifications pending, from the ConfigStatusPending table,
in a readable format.
Syntax
aaDBChangesPending
Permission
Execute permission defaults to the public group.
See Also
aaCommitChanges
aaCleanupAfterCommit
aaDBConfig
Returns a summary of the current database configuration, such as number of
tags, number of tags per type, storage configuration, event tags, summary
configuration, and so on.
Syntax
aaDBConfig
Permission
Execute permission defaults to the public group.
aaDeleteOlderEvents
Deletes old events from event storage.
Syntax
aaDeleteOlderEvents
Remarks
This stored procedure is executed by the aaSpaceManager stored procedure
every ten minutes. The duration for which events are kept is stored in the
SystemParameter table. Events will be deleted from the EventHistory table.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaDeleteOlderSummaries
aaSpaceManager
aaDeleteOlderSummaries
Deletes old summaries from summary storage.
Syntax
aaDeleteOlderSummaries
Remarks
This stored procedure is executed by the aaSpaceManager stored procedure
every ten minutes. The duration for which summaries are kept is stored in the
SystemParameter table. Summaries will be deleted from the
SummaryHistory table.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaDeleteOlderEvents
aaSpaceManager
aaDeleteTag
Deletes a tag from the database.
Syntax
aaDeleteTag TagName
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaAddTag
aaDetectorStringSelect
Selects the detector string for a specified event tag.
Syntax
aaDetectorStringSelect TagName
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaActionStringSelect
aaDiscreteTagDelete
Deletes a discrete tag.
Syntax
aaDiscreteTagDelete wwTagKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaDiscreteTagInsert
aaDiscreteTagUpdate
aaDiscreteTagSelect
aaDiscreteTagInsert
Inserts a discrete tag.
Syntax
aaDiscreteTagInsert TagName, Description, AcquisitionType,
StorageType, StorageRate, ItemName, TimeDeadband,
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 InSQL. 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 Industrial Application
Server (IAS) use IAS as the current editor. If you modify an IAS tag using
the historian Configuration Editor, then the current editor for the tag is
changed to InSQL. However, the next time you redeploy the engine, the
changes are not preserved. 0 = IndustrialSQL Server; 1 = InTouch; 2 =
Application other than IndustrialSQL Server or InTouch. This value is of
data type int, with a default of 0.
MessageKey
The unique numerical identifier for a TRUE/FALSE message pair that can
be associated with a discrete tag. This value is of data type int, with a
default of 1.
InitialValue
The initial value as imported from an external source (for example, from
InTouch). This value is of data type tinyint, with a default of 0.
TopicKey
The unique numerical identifier for the topic. This value is of data type int,
with a default of NULL.
IOServerKey
The unique numerical identifier for the I/O Server. This value is of data
type int, with a default of NULL.
AIRetrievalMode
Used to specify the behavior of retrieval for data in active image. You can
either retrieve from all acquired data values that are currently in the active
image, or only the data values that are configured to be stored on disk.
Data on disk may be a subset of that in the active image, depending on the
storage rate for the tag.Valid values are: 0 = All of the values received into
the active image will be included in the returned data (default); 1 = Only
the values that will be moved into storage will be included in the returned
data. This value is of data type tinyint, with a default of 0.
SamplesInActiveImage
The number of samples that the active image holds for the tag. 0 indicates
that the active image is using the default of 65 values. The higher the
number of samples, the higher the load on memory resources.This value is
of data type int, with a default of 0.
ServerTimeStamp
Used to specify whether local timestamping by the IndustrialSQL Server
is used. 0 = The IDAS timestamp is used; 1 = The IndustrialSQL Server
time is used for the timestamp. If a fast-changing tag is configured to use
server timestamping, the packet of data that is sent to the storage
subsystem may contain multiple data values with the same timestamp,
which may affect data calculations, such as for swinging door storage.
This value is of data type bit, with a default of 0.
DeadbandType
The type of delta storage deadband to be applied for the tag. This setting is
only in effect if delta storage is configured for the tag. 1= Time and/or
value deadband; 2 = Rate (swinging door) deadband. This value is of data
type smallint, with a default of 1.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaDiscreteTagDelete
aaDiscreteTagUpdate
aaDiscreteTagSelect
aaDiscreteTagSelect
Selects a discrete tag.
Syntax
aaDiscreteTagSelect wwTagKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaDiscreteTagInsert
aaDiscreteTagUpdate
aaDiscreteTagDelete
aaDiscreteTagUpdate
Updates a discrete tag.
Syntax
aaDiscreteTagUpdate wwTagKey, TagName, Description,
AcquisitionType, StorageType, StorageRate, ItemName,
TimeDeadband, CreatedBy, DateCreated, CurrentEditor,
MessageKey, InitialValue, TopicKey, IOServerKey,
aaEngineeringUnitDelete
Deletes an engineering unit.
Syntax
aaEngineeringUnitDelete EUKey
Arguments
EUKey
The unique numerical identifier for the engineering unit. This value is of
data type int, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaEngineeringUnitUpdate
aaEngineeringUnitSelect
aaEngineeringUnitInsert
aaEngineeringUnitInsert
Inserts an engineering unit.
Syntax
aaEngineeringUnitInsert Unit, DefaultTagRate,
IntegralDivisor
Arguments
Unit
The unit of measure. Examples are mph, grams, and pounds. This value is
of dataype nvarchar(32), with no default.
DefaultTagRate
The default rate, in milliseconds, at which tags are cyclically stored, based
on engineering units. Although the system does not make use of this
engineering unit based tag rate, you can reference this value in custom
SQL scripts. The value you enter for this tag rate does not affect the
default storage rate set for the tag. This value is of data type int, with a
default of 10000.
IntegralDivisor
The factor to be applied when integrating a rate with the units
[EngUnits/TimeUnit] to a quantity with units [EngUnits]. This factor is
called the integral divisor. The default value of 1 assumes a time unit of
seconds and ensures that a rate of [Unit/second] is correctly integrated to
[Unit]. For a time unit of minutes, set the integral divisor value to 60; for a
unit of hours, set the integral divisor value to 3600, and so on. The integral
divisor is applied similarly to rates or quantities that are not expressed in
terms of a time unit. For example, to convert watts to watt-hours, the
integral divisor is 1/3600. To convert watts to kilowatt-hours, the integral
divisor is 1/3600000. This value is of data type float(25), with a default of
1.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaEngineeringUnitDelete
aaEngineeringUnitSelect
aaEngineeringUnitUpdate
aaEngineeringUnitSelect
Selects an engineering unit.
Syntax
aaEngineeringUnitSelect EUKey
Arguments
EUKey
The unique numerical identifier for the engineering unit. This value is of
data type int, with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaEngineeringUnitUpdate
aaEngineeringUnitDelete
aaEngineeringUnitInsert
aaEngineeringUnitUpdate
Updates an engineering unit.
Syntax
aaEngineeringUnitUpdate EUKey, Unit, DefaultTagRate,
IntegralDivisor
Arguments
EUKey
The unique numerical identifier for the engineering unit. This value is of
data type int, with no default.
The remaining arguments are the same as for the aaEngineeringUnitInsert
stored procedure. However, only the IntegralDivisor argument has a default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaEngineeringUnitDelete
aaEngineeringUnitSelect
aaEngineeringUnitInsert
aaEventDetection
Detects the number of events in history in which the data value for the
specified tag matched the criteria defined by the remaining arguments. This
stored procedure is used by the event subsystem and should not be modified.
Syntax
aaEventDetection TagName, Operator, DetectValue, Edge,
Resolution, StartTime, EndTime
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
Operator
The comparison operator. Valid values are: >, >=, <, <=, =, <>. This value
is of data type char(2), with no default.
DetectValue
The value against which the stored values for the tag are compared to
determine if the event occurred. This value is of data type float(25), with a
default of none.
Edge
The type of edge detection result set that the query will return. Valid
values are NONE, LEADING, TRAILING, and BOTH. This value is of
data type char(8), with no default.
Resolution
The sampling rate, in milliseconds, for retrieving the data in cyclic mode.
The system returns values stored over the requested time period at the
interval specified by the resolution. For example, if you specify a 5000 ms
resolution, the system queries for all data during the time period and then
only returns those values that occur at each 5000 ms interval, starting with
the start date and ending with the end date. This value is of data type int,
with no default.
StartTime
The starting timestamp for the data to query. This value is of dataype
varchar(30), with no default.
EndTime
The ending timestamp for the data to query. This value is of dataype
varchar(30), with no default.
Remarks
You can apply a resolution only if you set the value of the Edge argument to
NONE.
Permission
Execute permission defaults to the aaAdministrators group.
aaEventHistoryInsert
Inserts a row into the EventHistory table for each occurrence of an event for a
specified event tag. This stored procedure is used by the event subsystem and
should not be modified.
Syntax
aaEventHistoryInsert TagName, DateTime, DetectDateTime,
Edge
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
DateTime
The timestamp reflecting when the event history data was acquired. This is
the time for when the event actually occurred. This time reflects the time
zone of the IndustrialSQL Server. This value is of data type datetime, with
no default.
DetectDateTime
The timestamp reflecting when the event was detected by the event
system. This value is of data type datetime, with no default.
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 int, with no default.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaEventHistorySelect
aaEventHistorySelect
Returns information stored in the EventHistory table for each specified event
tag.
Syntax
aaEventHistorySelect TagList, StartTime, EndTime
Arguments
TagList
A list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with no default.
StartTime
The starting timestamp for the data to query. This value is of data type
nvarchar(50), with no default.
EndTime
The ending timestamp for the data to query. This value is of data type
nvarchar(50), with no default.
Remarks
This stored procedure will return information for all events that occurred
between the starting time and the ending time.
Permission
Execute permission defaults to the public group.
See Also
aaEventHistoryInsert
aaEventSnapshotInsert
Inserts snapshot values into the AnalogSnapshot, DiscreteSnapshot, and
StringSnapshot tables. This stored procedure is used by the event subsystem
and should not be modified.
Syntax
aaEventSnapshotInsert EventLogKey, EventTime, EventTagName
Arguments
EventLogKey
The unique numerical identifier for the event occurrence. This value is of
data type int, with no default.
EventTime
The timestamp reflecting when the event history data was acquired. This is
the time for when the event actually occurred. This value is of data type
datetime, with no default.
EventTagName
The name of the event tag to which the snapshot tag is related. This value
is of data type nvarchar(256), with no default.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaEventSnapshotSelect
aaEventSnapshotSelect
Returns the snapshot tag values for each of the event tags specified by the tag
list.
Syntax
aaEventSnapshot TagList, StartTime, EndTime, OrderBy
Arguments
TagList
A list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with no default.
StartTime
The starting timestamp for the data to query. This value is of data type
nvarchar(50), with no default.
EndTime
The ending timestamp for the data to query. This value is of data type
nvarchar(50), with no default.
OrderBy
The name of the column in the v_EventSnapshot view used to order the
rows in the result set. The default is 'Event'.
Remarks
This stored procedure will return information for all events that occurred
between the starting time and the ending time.
Permission
Execute permission defaults to the public group.
See Also
aaEventSnapshotInsert
aaEventTagDelete
Deletes an event tag.
Syntax
aaEventTagDelete wwTagKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaEventTagUpdate
aaEventTagInsert
aaEventTagSelect
aaEventTagDetail
Returns the details for a specified event tag, including time detector
information, if applicable.
Syntax
aaEventTagDetail TagList
Arguments
TagList
The list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with a default of '%'.
Permission
Execute permission defaults to the public group
aaEventTagInsert
Inserts an event tag.
Syntax
aaEventTagInsert TagName, Description, CreatedBy,
DateCreated, CurrentEditor, ScanRate, TimeDeadband,
Logged, Status, PostDetectorDelay, UseThreadPool,
DetectorTypeKey, DetectorString, ActionTypeKey,
ActionString, Priority, Edge
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server 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 datetime, 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 InSQL. 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 Industrial Application
Server (IAS) use IAS as the current editor. If you modify an IAS tag using
the historian Configuration Editor, then the current editor for the tag is
changed to InSQL. However, the next time you redeploy the engine, the
changes are not preserved. 0 = IndustrialSQL Server; 1 = InTouch; 2 =
Application other than IndustrialSQL Server or InTouch. 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
The 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 for a particular type of detector. Event tags and
detectors are linked via 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 IndustrialSQL Server. 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 via 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 are executed on
the local IndustrialSQL Server. 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.
See Also
aaEventTagDelete
aaEventTagUpdate
aaEventTagSelect
aaEventTagSelect
Selects an event tag.
Syntax
aaEventTagSelect wwTagKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaEventTagUpdate
aaEventTagInsert
aaEventTagDelete
aaEventTagSelectAll
Used by the event system to determine changes for dynamic reinitialization.
Syntax
aaEventTagSelectAll
Permission
Execute permission defaults to the public group.
See Also
aaEventTagSelectDeleted
aaEventTagSelectDisabled
aaEventTagSelectInserted
aaEventTagSelectUpdated
aaEventTagSelectDeleted
Used by the event system to determine changes for dynamic reinitialization.
Syntax
aaEventTagSelectDeleted
Permission
Execute permission defaults to the public group.
See Also
aaEventTagSelectInserted
aaEventTagSelectUpdated
aaEventTagSelectDisabled
aaEventTagSelectDisabled
Used by the event system to determine changes for dynamic reinitialization.
Syntax
aaEventTagSelectDisabled
Permission
Execute permission defaults to the public group.
See Also
aaEventTagSelectDeleted
aaEventTagSelectUpdated
aaEventTagSelectInserted
aaEventTagSelectAll
aaEventTagSelectInserted
Used by the event system to determine changes for dynamic reinitialization.
Syntax
aaEventTagSelectInserted
Permission
Execute permission defaults to the public group.
See Also
aaEventTagSelectDeleted
aaEventTagSelectUpdated
aaEventTagSelectDisabled
aaEventTagSelectAll
aaEventTagSelectUpdated
Used by the event system to determine changes for dynamic reinitialization.
Syntax
aaEventTagSelectUpdated
Permission
Execute permission defaults to the public group.
See Also
aaEventTagSelectDeleted
aaEventTagSelectDisabled
aaEventTagSelectInserted
aaEventTagSelectAll
aaEventTagUpdate
Updates an event tag.
Syntax
aaEventTagUpdate wwTagKey, TagName, Description,
CreatedBy, DateCreated, CurrentEditor, ScanRate,
TimeDeadband, Logged, Status, PostDetectorDelay,
UseThreadPool, DetectorTypeKey, DetectorString,
ActionTypeKey, ActionString, Priority, Edge
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
The remaining arguments are the same as for the aaEventTagInsert stored
procedure. However, wwTagKey, TagName, Description, DateCreated,
DetectorString, and ActionString do not have defaults.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaEventTagDelete
aaEventTagInsert
aaEventTagSelect
aaGetDbRevision
Used to determine the current revision number of the database.
Syntax
aaGetDbRevision
Permission
Execute permission defaults to the public group.
aaGetLastTagKey
Returns the details for the last inserted tag.
Syntax
aaGetLastTagKey TagType
Arguments
TagType
The type of tag. 1 = Analog; 2 = Discrete; 3 = String; 4 = Complex; 5 =
Event. This value is of data type int, with no default.
Permission
Execute permission defaults to the public group.
aaHistorianConfigNSExpand
Expands the tree view under an IndustrialSQL Server historian in the
namespace. This stored procedure is used by the Configuration Editor
component of the System Management Console and should not be modified.
Syntax
aaHistorianConfigNSExpand PKey
Arguments
PKey
A local variable used to identify the IndustrialSQL Server historian in the
namespace. This value is of data type int, with no default.
Remarks
An object can have one or more objects below it in the namespace hierarchy.
Permission
Execute permission defaults to the public group.
aaHistorianNSExpand
Expands the tree view under an IndustrialSQL Server historian in the
namespace.
Syntax
aaHistorianNSExpand PKey
Arguments
PKey
A local variable used to identify the IndustrialSQL Server historian in the
namespace. This value is of data type int, with no default.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSExpand
aaPublicNSExpand
aaSystemNSExpand
aaHistorianStatusSelect
Used to select the value of the database status flag, DbStatus.
Syntax
aaHistorianStatusSelect
Remarks
This stored procedure is used by the System Management Console to
determine the state of a database modification.
Permission
Execute permission defaults to the public group.
See Also
aaHistorianStatusSet
aaHistorianStatusSet
Sets the value of the status flag, DbStatus, to a value greater than 0 when a
database modification needs to be processed by the server (back end). Sets the
value of DbStatus back to 0 when a database modification is complete.
Syntax
aaHistorianStatusSet DbStatus, Acquisition, Storage,
DBServer
Arguments
DbStatus
For releases prior to 8.0, used to store the status of server reinitializations.
2 = Certain columns in the Tag, AnalogTag, DiscreteTag, StringTag,
Topic, and IOServer tables were changed; 3 = Reinitialization needed; 4 =
Commit phase of a database update is in progress; 0 = Reinitialization
complete. A negative value indicates that an error was encountered during
reinitialization. This value is of data type int, with no default.
Acquisition
Used with DbStatus to indicate to the back end whether the acquisition
subsystem needs to be restarted. 0 = Restart not needed; 1 = Restart
needed. Currently not used. This value is of data type int, with a default of
0.
Storage
Used with DbStatus to indicate to the back end whether the storage
subsystem needs to be restarted. 0 = Restart not needed; 1 = Restart
needed. Currently not used. This value is of data type int, with a default of
0.
DBServer
Used with DbStatus to indicate to the back end whether the database
server needs to be restarted. 0 = Restart not needed; 1 = Restart needed.
Currently not used. This value is of data type int, with a default of 0.
Note Only the first argument is required; the others are used to indicate that a
specific sub-system needs to be initialized.
Remarks
When a change is made to the Runtime database configuration using the
System Management Console, the value of the DbStatus attribute in the
StorageNode table is set to a value greater than 0, meaning that modifications
are outstanding and a reininitialization has yet to occur. The System
Management Console, after detecting that a change is outstanding based on the
value of DbStatus, makes the required changes, reinitializes the IndustrialSQL
Server historian, if necessary, and then sets the value of DbStatus back to 0,
meaning that reinitialization has been completed.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaHistorianStatusSelect
aaHistoryBlockSelect
Returns the list of history blocks for the selected time period. If no arguments
are passed, the complete list is returned.
Syntax
aaHistoryBlockSelect FromDate, ToDate
Arguments
FromDate
The starting timestamp for the history block. This value is of data type
datetime, with a default of NULL.
ToDate
The ending timestamp for the history block. This value is of data type
datetime, with a default of NULL.
Permission
Execute permission defaults to the public group.
aaInTouchNodeTagList
Used by the System Management Console to display a list of imported tags for
an InTouch node.
Syntax
aaInTouchNodeTagList NodeKey, FilterStr
Arguments
NodeKey
The unique numerical identifier for the named InTouch node. This value is
of data type int, with a default of NULL.
FilterStr
Used to order the tagnames in the namespace. This value is of data type
nvarchar(100), with a default of NULL.
Remarks
This stored procedure returns the IndustrialSQL Server historian tagname, the
original InTouch tagname, and the InTouch tag type (for example, memory
integer).
Permission
Execute permission defaults to the public group.
aaIODriverDelete
Deletes an IDAS.
Syntax
aaIODriverDelete IODriverKey
Arguments
IODriverKey
The unique identifier for an IDAS. This value is of data type int, with no
default.
Permission
Execute permission defaults to the aaAdministrators and aaPowerUsers
groups.
See Also
aaIODriverSelect
aaIODriverInsert
aaIODriverUpdate
aaIODriverInsert
Inserts an IDAS.
Syntax
aaIODriverInsert StorageNodeKey, ComputerName,
StoreForwardMode, StoreForwardPath, MinMBThreshold,
AltComputerName, Enabled, StoreForwardDuration,
AutonomousStartupTimeout, BufferCount, FileChunkSize,
ForwardingDelay, ConnectionTimeout
Arguments
StorageNodeKey
The unique numerical identifier for the storage node. This value is of data
type int, with a default of 1.
ComputerName
The name of the computer on which the IDAS runs. This value is of data
type nvarchar(255), with a default of the name of the local server running
Microsoft® SQL Server.
StoreForwardMode
Used to specify whether or not store-and-forward capability is enabled. If
enabled, and the network connection between the IDAS and the storage
node fails, data will be "buffered" to the location specified by the store-
and-forward path. Valid values are: 0 = Disabled; 1 = Enabled; 2 =
Autonomous. The Autonomous mode (2) is an extension of the normal
store-and-forward mode (1). It allows the IDAS to start up using an IDAS
configuration file and collect data in store-and-forward mode if the
network connection to the IndustrialSQL Server is not available. This
value is of data type tinyint, with a default of 0.
StoreForwardPath
Used to specify the path for the IDAS data buffer on the local hard drive of
the IDAS computer. The path should be absolute (for example,
c:\IDASBuffer). Data is written to this path until the minimum threshold
for the buffer is reached. Remote buffer paths are not supported. If a
invalid path or no path is specified, data is stored to the default path, which
is C:\Document and Settings\All Users\Application Data\ArchestrA\SF.
This value is of data type nvarchar(255), with a default of an empty string.
MinMBThreshold
The minimum amount of free disk space, in megabytes, at which IDAS
stops collecting data in the store-and-forward buffer. This value is of data
type int, with a default of 16.
AltComputerName
The name of the computer on which an optional, redundant IDAS runs.
This should be set to an empty string if no redundant IDAS is specified.
Make sure that the IDAS software is installed on the target failover
computer. If the failure of the primary IDAS is detected by the system, the
failover IDAS is automatically started. The failover IDAS is shut down
after the primary IDAS is back online. This value is of data type
nvarchar(255), with a default of an empty string.
Enabled
Used to specify whether the IDAS is enabled or not. 0 = Not enabled; 1 =
enabled. Disabling the IDAS allows for the configuration to be retained in
the database, even though the IDAS is removed from the system. This
value is of data type bit, with a default of 1.
StoreForwardDuration
The minimum duration, in seconds, for the IDAS to function in store-and-
forward mode. The IDAS functions in store-and-forward mode for this
length of time even if the condition that caused IDAS to function in store-
and-forward mode no longer exists. The maximum duration is 3600
seconds, and the minimum is 15 seconds. This value is of data type int,
with a default of 180.
AutonomousStartupTimeout
The amount of time, in seconds, that the autonomous IDAS should wait
for configuration commands when started by the Configuration service
before going to the autonomous mode. This timeout may need to be
increased only if you have a large number of IDASs configured as
autonomous on a slow network. This value is of data type int, with a
default of 60.
BufferCount
The number of 64 KB buffers pre-allocated for buffering data. This
number may need to be increased to accommodate high data rates. This
value is of data type int, with a default of 128.
FileChunkSize
The size, in bytes, of the data "chunks" that are sent to the historian when
store-and-forward data is forwarded. The size of the chunks can be
decreased to accommodate slower networks. Decrease this number only if
the forwarding delay is greater than zero. This value is of data type int,
with a default of 65536.
ForwardingDelay
The interval, in milliseconds, at which "chunks" of store-and-forward data
are forwarded to the historian. The length of the interval may need to be
increased to accommodate slower networks. This value is of data type int,
with a default of 0.
ConnectionTimeout
The amount of time, in seconds, that the Configuration service attempts to
communicate with an IDAS for configuration/reconfiguration. If this
timeout elapses, the Configuration service assumes that the IDAS
connection has been dropped. This number may need to be increased to
accommodate slower networks. This value is of data type int, with a
default of 30.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaIODriverDelete
aaIODriverSelect
aaIODriverUpdate
aaIODriverSelect
Selects an IDAS.
Syntax
aaIODriverSelect IODriverKey
Arguments
IODriverKey
The unique identifier for an IDAS. This value is of data type int, with a
default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaIODriverDelete
aaIODriverInsert
aaIODriverUpdate
aaIODriverUpdate
Updates an IDAS.
Syntax
aaIODriverUpdate IODriverKey, StorageNodeKey,
ComputerName, StoreForwardMode, StoreForwardPath,
MinMBThreshold, AltComputerName, Enabled,
StoreForwardDuration, AutonomousStartupTimeout,
BufferCount, FileChunkSize, ForwardingDelay,
ConnectionTimeout
Arguments
IODriverKey
The unique identifier for an IDAS. This value is of data type int, with no
default.
The remaining arguments are the same as for the aaIODriverInsert stored
procedure. However, only StorageNodeKey, MinMBThreshold, Enabled,
StoreForwardDuration, AutonomousStartupTimeout, BufferCount,
FileChunkSize, ForwardingDelay, and ConnectionTimeout have defaults.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaIODriverDelete
aaIODriverSelect
aaIODriverInsert
aaIOServerDelete
Deletes an I/O Server from the system configuration.
Syntax
aaIOServerDelete IOServerKey
Arguments
IOServerKey
The unique numerical identifier for the I/O Server. This value is of data
type int, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaIOServerInsert
aaIOServerUpdate
aaIOServerSelect
aaIOServerInsert
Inserts an I/O Server into the system configuration.
Syntax
aaIOServerInsert StorageNodeKey, ApplicationName,
Description, Path, ComputerName, AutoStart, ExeType,
InitializationStatus, ProtocolType, AltComputerName,
IODriverKey
Arguments
StorageNodeKey
The unique numerical identifier for the storage node. This value is of data
type int, with a default of 1.
ApplicationName
The application name of the I/O Server. This name is usually the same as
the executable file name. This value is of dataype nvarchar(32), with no
default.
Description
The description of the I/O Server. This value is of data type nvarchar(50),
with a default of NULL.
Path
The full UNC path (including the filename) to locate the executable file
for the I/O Server. If the I/O Server type key is specified, the filename may
be omitted. This value is nvarchar(255), with a default of NULL.
ComputerName
The name of the computer on which the I/O Server runs.This value is of
data type nvarchar(255), with no default.
AutoStart
Used to control how the I/O Server starts up. 0 = Automatic startup when
the system starts. 1 = Manual startup required. Currently not used. This
value is of data type bit, with a default of 0.
ExeType
The type of executable for the I/O Server. Used by the InSQL Console to
determine how to start the I/O Server. 0 = Service; 1 = Console
application; 2 = Windows application. This value is of data type int, with a
default of 0.
InitializationStatus
The control flag used to ensure that each I/O Server has been asked for the
data type (integer or real) of each tag that it will send. Only needed after a
database modification. This value is of data type tinyint, with no default.
ProtocolType
The protocol used by the IndustrialSQL Server to communicate with the
I/O Server. 1 = DDE; 2 = SuiteLink™; 3 = IndustrialSQL Server named
pipe driver (for compatibility with IndustrialSQL Server 3.0 and previous
versions). If the IndustrialSQL Server is running on the Windows Server
2003 operating system, DDE is not supported. This value is of data type
int, with a default of 1.
AltComputerName
The name of the computer on which an optional, failover I/O Server runs.
The failover I/O Server must be running in order for the switch to be
made. This value is nvarchar(255), with a default of NULL.
IODriverKey
The unique identifier for an IDAS. This value is of data type int, with a
default of 2.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaIOServerUpdate
aaIOServerSelect
aaIOServerDelete
aaIOServerSelect
Selects an I/O Server from the system configuration.
Syntax
aaIOServerSelect IOServerKey
Arguments
IOServerKey
The unique numerical identifier for the I/O Server. This value is of data
type int, with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaIOServerInsert
aaIOServerUpdate
aaIOServerDelete
aaIOServerTypeDelete
Deletes an I/O Server type from the system configuration.
Syntax
aaIOServerTypeDelete ApplicationName
Arguments
ApplicationName
The application name of the I/O Server. This name is usually the same as
the executable file name. This value is of dataype nvarchar(32), with no
default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaIOServerTypeInsert
aaIOServerTypeUpdate
aaIOServerTypeSelect
aaIOServerTypeInsert
Inserts an I/O Server type into the system configuration.
Syntax
aaIOServerTypeInsert ApplicationName, Description,
ExeName, Revision, Platform
Arguments
ApplicationName
The application name of the I/O Server. This name is usually the same as
the executable file name. This value is of dataype nvarchar(32), with no
default.
Description
The description of the I/O Server type. This value is of data type
nvarchar(50), with a default of NULL.
ExeName
The name of the I/O Server's executable file. This value is nvarchar(255),
with a default of NULL.
Revision
The revision number for the I/O Server. This value is of data type
nchar(20), with a default of NULL.
Platform
The operating system required by the I/O Server. Valid operating systems
are: WINDOWS NT, WINDOWS 95, WINDOWS 98, WINDOWS XP,
WINDOWS 2000, WINDOWS 2003. This value is of data type nchar(20),
with a default of NULL.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaIOServerTypeUpdate
aaIOServerTypeSelect
aaIOServerTypeDelete
aaIOServerTypeSelect
Selects an I/O Server type from the system configuration.
Syntax
aaIOServerTypeSelect ApplicationName
Arguments
ApplicationName
The application name of the I/O Server. This name is usually the same as
the executable file name. This value is of data type nvarchar(32), with a
default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaIOServerTypeInsert
aaIOServerTypeUpdate
aaIOServerTypeDelete
aaIOServerTypeUpdate
Updates an I/O Server type in the system configuration.
Syntax
aaIOServerTypeUpdate ApplicationName, Description,
ExeName, Revision, Platform
Arguments
All arguments are the same as for the aaIOServerTypeInsert stored
procedure. However, none of the arguments have defaults.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaIOServerTypeInsert
aaIOServerTypeSelect
aaIOServerTypeDelete
aaIOServerUpdate
Updates an I/O Server in the system configuration.
Syntax
aaIOServerUpdate IOServerKey, StorageNodeKey, IODriverKey,
ApplicationName, Description, Path, ComputerName,
AutoStart, ExeType, InitializationStatus, ProtocolType,
AltComputerName
Arguments
IOServerKey
The unique numerical identifier for the I/O Server. This value is of data
type int, with no default.
The remaining arguments are the same as for the aaIOServerInsert stored
procedure. However, only the AltComputerName argument has a default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaIOServerInsert
aaIOServerSelect
aaIOServerDelete
aaLimitDelete
Deletes a limit.
Syntax
aaLimitDelete TagName, ContextKey, LimitNameKey
Arguments
All arguments are the same as for the aaLimitInsert stored procedure.
However, none of the arguments have defaults.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaLimitInsert
aaLimitUpdate
aaLimitSelect
aaLimitInsert
Inserts a limit.
Syntax
aaLimitInsert TagName, ContextKey, LimitType, Value,
LimitNameKey, Priority, Checked, Description
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
ContextKey
The unique numerical identifier for the context. This value is of data type
int, with a default of 1.
LimitType
The type of limit; that is, whether it is a rising (up) or falling (down) limit.
0 = Rising; 1 = Falling. This value is of data type int, with a default of 1.
Value
The value that is used as a specific limit for a tag. In theory, a tag can have
an infinite number of limits defined. This value is of data type real, with
no default.
LimitNameKey
The unique numerical identifier associated with the limit name. This value
is of data type int, with no default.
Priority
The priority for the limit. Priorities can range from 1 to over 2 billion, with
1 being the highest priority. This value is of data type int, with a default of
1.
Checked
Used to specify whether a tag imported from InTouch is configured for
automatic limit checking. Only checked limits are imported. 0 = Checking
disabled; 1 = Checking enabled. This value is of data type bit, with a
default of 1.
Description
The description of the limit. This value is of data type nvarchar(50), with a
default of NULL.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaLimitUpdate
aaLimitSelect
aaLimitDelete
aaLimitNameDelete
Deletes a limit name.
Syntax
aaLimitNameDelete LimitNameKey
Arguments
LimitNameKey
The unique numerical identifier associated with the limit name. This value
is of data type int, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaLimitNameInsert
aaLimitNameUpdate
aaLimitNameSelect
aaLimitNameInsert
Inserts a limit name.
Syntax
aaLimitNameInsert Name
Arguments
Name
The name for the limit. This value is of data type nvarchar(20), with a
default of an empty string.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaLimitNameUpdate
aaLimitNameSelect
aaLimitNameDelete
aaLimitNameSelect
Selects a limit name.
Syntax
aaLimitNameSelect LimitNameKey
Arguments
LimitNameKey
The unique numerical identifier associated with the limit name. This value
is of data type int, with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaLimitNameInsert
aaLimitNameUpdate
aaLimitNameDelete
aaLimitNameUpdate
Updates a limit name.
Syntax
aaLimitNameUpdate LimitNameKey, Name
Arguments
LimitNameKey
The unique numerical identifier associated with the limit name. This value
is of data type int, with no default.
Name
The name for the limit. This value is of data type nvarchar(20), with no
default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaLimitNameInsert
aaLimitNameSelect
aaLimitNameDelete
aaLimitSelect
Selects a limit.
Syntax
aaLimitSelect TagName
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system. The
limit will be selected for the specified tag. This value is of data type
nvarchar(256), with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaLimitInsert
aaLimitUpdate
aaLimitDelete
aaLimitUpdate
Updates a limit.
Syntax
aaLimitUpdate TagName, ContextKey, LimitType, Value,
LimitNameKey, Priority, Checked, Description
Arguments
All arguments are the same as for the aaLimitInsert stored procedure.
However, only the Description argument has a default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaLimitInsert
aaLimitSelect
aaLimitDelete
aaMessageDelete
Deletes a message for a discrete tag.
Syntax
aaMessageDelete MessageKey
Arguments
MessageKey
The unique numerical identifier for a TRUE/FALSE message pair that can
be associated with a discrete tag. This value is of data type int, with no
default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaMessageUpdate
aaMessageInsert
aaMessageSelect
aaMessageInsert
Inserts a message for a discrete tag.
Syntax
aaMessageInsert Message0, Message1
Arguments
Message0
The message associated with the FALSE state of the discrete tag. The
maximum number of characters is 64. A discrete tag set to 0 is in the
FALSE state. This value is of data type nvarchar(64), with a default of
NULL.
Message1
The message associated with the TRUE state of the discrete tag. The
maximum number of characters is 64. A discrete tag set to 1 is in the
TRUE state. This value is of data type nvarchar(64), with a default of
NULL.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaMessageSelect
aaMessageUpdate
aaMessageDelete
aaMessageSelect
Selects a message for a discrete tag.
Syntax
aaMessageSelect MessageKey
Arguments
MessageKey
The unique numerical identifier for a TRUE/FALSE message pair that can
be associated with a discrete tag. This value is of data type int, with a
default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaMessageUpdate
aaMessageInsert
aaMessageDelete
aaMessageUpdate
Updates a message for a discrete tag.
Syntax
aaMessageUpdate MessageKey, Message0, Message1
Arguments
MessageKey
The unique numerical identifier for a TRUE/FALSE message pair that can
be associated with a discrete tag. This value is of data type int, with no
default.
The remaining arguments are the same as for the aaMessageInsert stored
procedure. However, none of the arguments have defaults.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaMessageSelect
aaMessageInsert
aaMessageDelete
aaModLogStatus
Used to retrieve the status of modification tracking.
Syntax
aaModLogStatus
Remarks
This stored procedure is used by the System Management Console.
Modification tracking is controlled by the value of the ModLogTrackingStatus
system parameter, which is stored in the Value column of the SystemParameter
table. If the value of this column is set to a value from 1 to 7, then modification
tracking is on (0 = off).
Permission
Execute permission defaults to the public group.
aaPrivateNSAddGroup
Adds a group object in the private namespace under the specified parent object
in the namespace hierarchy.
Syntax
aaPrivateNSAddGroup Name, ParentKey, Type
Arguments
Name
The name of this object in the hierarchy. This value is of data type
nvarchar(255), with no default.
ParentKey
The unique identifier for a named object in this namespace. This value is
of data type int, with no default.
Type
The value that specifies the type of namespace. 1 to 6 = Tag; 1 to 2 million
= System; 2+ million = Groups. This value is of data type int, with a
default of 1000000.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSDeleteGroup
aaPrivateNSUpdateGroup
aaPrivateNSAddLeaf
Adds a single object in the private namespace under the currently selected
object in the namespace hierarchy.
Syntax
aaPrivateNSAddLeaf wwTagKey, NameKey, ServerKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
NameKey
The unique identifier for the object in the namespace. This value is of data
type int, with no default.
ServerKey
The unique numerical identifier for the IndustrialSQL Server. This value is
of data type int, with a default of 1.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSDeleteLeaf
aaPrivateNSDeleteGroup
Deletes a group object, as well as any objects under it, in the private
namespace.
Syntax
aaPrivateNSDeleteGroup NameKey
Arguments
NameKey
The unique identifier for the object in the namespace. This value is of data
type int, with no default.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSAddGroup
aaPrivateNSUpdateGroup
aaPrivateNSDeleteLeaf
Deletes a single object in the private namespace.
Syntax
aaPrivateNSDeleteLeaf NameKey, wwTagKey
Arguments
NameKey
The unique identifier for the object in the namespace. This value is of data
type int, with no default.
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSAddLeaf
aaPrivateNSExpand
Expands the tree view one level under a single parent object in the private
namespace.
Syntax
aaPrivateNSExpand PKey, FilterStr
Arguments
PKey
A local variable used to identify the object in the namespace. This value is
of data type int, with no default.
FilterStr
Used to order the tagnames in the namespace. This value is of data type
nvarchar(100), with a default of NULL.
Remarks
A parent object can have one or more objects below it in the namespace
hierarchy.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSSelect
aaPrivateNSSelect
Selects all valid group objects (items) for the current user in the private
namespace.
Syntax
aaPrivateNSSelect
Permission
Execute permission defaults to the public group.
See Also
aaPublicNSExpand
aaPrivateNSUpdateGroup
Updates a group object in the private namespace.
Syntax
aaPrivateNSUpdateGroup NameKey, Name, Type
Arguments
NameKey
The unique identifier for the object in the namespace. This value is of data
type int, with no default.
Name
The name of this object in the hierarchy. This value is of data type
nvarchar(255), with no default.
Type
The value that specifies the type of namespace. 1 to 6 = Tag; 1 to 2 million
= System; 2+ million = Groups. This value is of data type int, with no
default.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSDeleteGroup
aaPrivateNSAddGroup
aaPublicNSAddGroup
Adds a group object in the public namespace under the specified parent object
in the namespace hierarchy.
Syntax
aaPublicNSAddGroup Name, ParentKey, Type
Arguments
Name
The name of this object in the hierarchy. This value is of data type
nvarchar(255), with no default.
ParentKey
The unique identifier for a named object in this namespace. This value is
of data type int, with no default.
Type
The value that specifies the type of namespace. 1 to 6 = Tag; 1 to 2 million
= System; 2+ million = Groups. Within the system range, the following
values designate ArchestrA object types: 1999023 = Galaxy; 1999001 =
WinPlatform object; 1999003 = AppEngine object; 1999013 = Area
object; 1999011 = DDESuiteLinkClient, OPCClient, and InTouchProxy
objects; 1999024 = RedundantDIObject object; 1999033 = Undeployed
object represented by a generic name; 1999901 = ApplicationObject;
1999902 = Traceability object. This value is of data type int, with a default
of 1000000.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaPublicNSDeleteGroup
aaPublicNSUpdateGroup
aaPublicNSAddLeaf
Adds a single object in the public namespace under the currently selected
object in the namespace hierarchy.
Syntax
aaPublicNSAddLeaf wwTagKey, NameKey, ServerKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
NameKey
The unique identifier for the object in the namespace. This value is of data
type int, with no default.
ServerKey
The unique numerical identifier for the IndustrialSQL Server. This value is
of data type int, with a default of 1.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaPublicNSDeleteLeaf
aaPublicNSDeleteGroup
Deletes a group object, as well as any objects under it, in the public namespace.
Syntax
aaPublicNSDeleteGroup NameKey
Arguments
NameKey
The unique identifier for the object in the namespace. This value is of data
type int, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaPublicNSAddGroup
aaPrivateNSUpdateGroup
aaPublicNSDeleteLeaf
Deletes a single object in the public namespace.
Syntax
aaPublicNSDeleteLeaf NameKey, wwTagKey
Arguments
NameKey
The unique identifier for the object in the namespace. This value is of data
type int, with no default.
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaPublicNSAddLeaf
aaPublicNSExpand
Expands the tree view one level under a single parent object in the public
namespace.
Syntax
aaPublicNSExpand PKey, FilterStr
Arguments
PKey
A local variable used to identify the object in the namespace. This value is
of data type int, with no default.
FilterStr
Used to order the tagnames in the namespace. This value is of data type
nvarchar(100), with a default of NULL.
Remarks
A parent object can have one or more objects below it in the namespace
hierarchy.
Permission
Execute permission defaults to the public group.
See Also
aaPublicNSSelect
aaPublicNSSelect
Selects all valid group objects (items) in the public namespace.
Syntax
aaPublicNSSelect
Permission
Execute permission defaults to the public group.
See Also
aaPublicNSExpand
aaPublicNSUpdateGroup
Updates a group object in the public namespace.
Syntax
aaPublicNSUpdateGroup NameKey, Name, Type
Arguments
NameKey
The unique identifier for the object in the namespace. This value is of data
type int, with no default.
Name
The name of this object in the hierarchy. This value is of data type
nvarchar(255), with no default.
Type
The value that specifies the type of namespace. 1 to 6 = Tag; 1 to 2 million
= System; 2+ million = Groups. Within the system range, the following
values designate ArchestrA object types: 1999023 = Galaxy; 1999001 =
WinPlatform object; 1999003 = AppEngine object; 1999013 = Area
object; 1999011 = DDESuiteLinkClient, OPCClient, and InTouchProxy
objects; 1999024 = RedundantDIObject object; 1999033 = Undeployed
object represented by a generic name; 1999901 = ApplicationObject;
1999902 = Traceability object. This value is of data type int, with no
default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaPublicNSDeleteGroup
aaPublicNSAddGroup
aaRedirectToInTouch
Redirects the tag address (item name) to the InTouch node, rather than to the
original I/O Server.
Syntax
aaRedirectToInTouch IOServerKey, InTouchNodeKey
Arguments
IOServerKey
The unique numerical identifier for the I/O Server. This value is of data
type int, with no default.
InTouchNodeKey
The unique numerical identifier for the named InTouch node. This value is
of data type int, with no default.
Remarks
When you redirect to InTouch HMI software, all tag values will come from the
HMI, not directly from the I/O Server. If you redirect an I/O Server, all topics
and tags for that particular I/O Server are affected.
Permission
Execute permission defaults to the aaAdministrators group.
aaSetAISamples
Sets the number of samples that the active image can hold for a specified tag.
This stored procedure is used by the IndustrialSQL Server historian and should
not be executed by users.
Syntax
aaSetAISamples TagName, Samples
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
Samples
The number of samples that the active image holds for the tag. 0 indicates
that the active image is using the default of 65 values. The higher the
number of samples, the higher the load on memory resources. This value
is of data type int, with no default.
Remarks
The system initially sets the number of samples for each tag to 65. The number
of samples for a tag is stored in the SampleInActiveImage column of the Tag
table.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaSetCalculatedAISamples
aaUpdateCalculatedAISamples
aaSetCalculatedAISamples
Updates the value of the SamplesInActiveImage column of the Tag table with
the current value of the CalculatedAISamples column.
Syntax
aaSetCalculatedAISamples
Remarks
This stored procedure executes at system startup. Also, this stored procedure
only executes if the AIAutoResize system parameter is set to 1.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaSetAISamples
aaUpdateCalculatedAISamples
aaSetServerTimeStamp
Specifies whether or not incoming data values will be timestamped using the
time of the local IndustrialSQL Server historian.
Syntax
aaSetServerTimeStamp TopicName, ServerTimeStamp
Arguments
TopicName
The name of the topic. This value is of data type nvarchar(80), with no
default.
ServerTimeStamp
Used to specify whether local timestamping by the IndustrialSQL Server
is used. 0 = The IDAS timestamp is used; 1 = The IndustrialSQL Server
time is used for the timestamp. If a fast-changing tag is configured to use
server timestamping, the packet of data that is sent to the storage
subsystem may contain multiple data values with the same timestamp,
which may affect data calculations, such as for swinging door storage.
This value is of data type bit, with a default of 0.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
aaSetStorageRule
Sets storage rules at various levels of the tag definition.
Syntax
aaSetStorageRule Type, Key, StorageType, StorageRate,
TimeDB, ValueDB, AcqType, DBType, RateDB,
ServerTimeStamp, LateData, IdleDuration, ProcInterval
Arguments
Type
The level at which the new storage rule will be set for the tag definition. 1
= I/O Server; 2 = Topic. This value is of data type tinyint, with no default.
Key
The database key value for the relevant type, either the I/O Server key or
the topic key. This value is of data type int, with no default.
StorageType
The type of storage defined for the tag. 0 = Not stored; 1 = Cyclic; 2 =
Delta; 3 = Forced storage; 17 = The storage type has been changed from
cyclic to "not stored." 18 = The storage type has been changed from delta
to "not stored." 19 = The storage type has been changed from "forced" to
"not stored." This value is of data type tinyint, with no default.
StorageRate
The rate at which the tag is stored if the storage type is cyclic. The rate is
in seconds. This value is of data type int, with a default of 0.
TimeDB
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 -1.
ValueDB
The percentage of the difference between the minimum and maximum
engineering units for the tag. Any data values that change less than the
specified deadband are not stored. The value deadband applies to delta
storage only. A value of 0 indicates that a value deadband will not be
applied. This value is of data type float, with a default of -1.
AcqType
Used to turn acquisition on or off. 0 = Acquisition off; 1 = Acquisition on.
This value is of data type smallint, with a default of -1.
DBType
The type of delta storage deadband to be applied for the tag. This setting is
only in effect if delta storage is configured for the tag. 1= Time and/or
value deadband; 2 = Rate (swinging door) deadband. This value is of data
type smallint, with a default of -1.
RateDB
Used to percentage of deviation in the full-scale value range for an analog
tag. The swinging door (rate) deadband applies to delta storage only. Time
and/or value deadbands can be used in addition to the swinging door
deadband. Any value greater than 0 can be used for the deadband. A value
of 0 indicates that a swinging door deadband will not be applied. This
value is of data type float, with a default of -1.
ServerTimeStamp
Used to specify whether local timestamping by the IndustrialSQL Server
is used. 0 = The IDAS timestamp is used; 1 = The IndustrialSQL Server
time is used for the timestamp. If a fast-changing tag is configured to use
server timestamping, the packet of data that is sent to the storage
subsystem may contain multiple data values with the same timestamp,
which may affect data calculations, such as for swinging door storage.
This value is of data type smallint, with a default of -1.
LateData
Used to enable acquisition of "late" data. 0 = Late data disabled; 1 = Late
data enabled. This value is of data type smallint, with a default of -1.
IdleDuration
The amount of time, in seconds, before data is processed from the I/O
Server. For example, if you set this value to 60 seconds, data from this I/O
Server is cached and only processed by the storage engine after no more
data has been received from the I/O Server for at least 60 seconds. This
value is of data type int, with a default of 60.
ProcInterval
The amount of time, in seconds, after which late data from the I/O Server
is processed, regardless of the idle duration. If the nature of the data is
such that the idle duration is never satisfied, the historian storage engine
processes data from the topic at least one time every processing interval.
The processing interval defaults to twice the idle duration and cannot be
set to a value less than the idle duration. This value is of data type int, with
a default of 120.
Remarks
To ignore an argument, set the value to -1.
Permission
Execute permission defaults to the aaAdministrators and aaPowerUsers
groups.
See Also
aaSetTagStorage
aaSetTagStorage
Sets storage on or off from various level of the tag definition.
Syntax
aaSetTagStorage Type, List, Set
Arguments
Type
The level at which the new storage rule will be set for the tag definition. 1
= I/O Server; 2 = Topic. This value is of data type tinyint, with no default.
List
If the type is an I/O Server, topic or public group, the IDENTITY key(s) of
the relevant type. If the type is a tag, a list of tagnames separated by
commas. This value is of data type nvarchar(4000), with no default.
Set
Used to set storage on or off. Valid values are ON, OFF. This value is of
dataype varchar(3), with no default.
Remarks
This stored procedure applies to analog, discrete, string and complex tag types.
Permissions
Execute permission defaults to the aaAdministrators and aaPowerUsers
groups.
Examples
The following example turns data storage off for all tags associated with I/O
Servers that are identified by the IOServerKeys 2 and 3.
aaSetTagStorage 1, '2,3', 'OFF'
The following example turns data storage on for the listed tags.
aaSetTagStorage 3, 'Tag1, Tag2, Tag3', 'ON'
See Also
aaSetStorageRule
aaSnapshotDetailSelect
Returns snapshot information from the columns of the SnapshotDetail table,
based on the storage size.
Syntax
aaSnapshotDetailSelect StorageSize
Arguments
StorageSize
The storage size, in bytes, of the tag value: -1 = Blob; 0 = Variable length
string; 1 = 1 byte; 2 = 2 byte; 4 = 4 byte; 8 = 8 byte. This value is of data
type int, with a default of NULL.
Remarks
If you do not pass an argument for the storage size, information for all storage
sizes in the table will be returned.
Permission
Execute permission defaults to the public group.
See Also
aaSnapshotDetailUpdate
aaSnapshotDetailUpdate
Updates the SnapshotDetail table.
Syntax
aaSnapshotDetailUpdate StorageSize, SnapshotSize,
ImageTime, ThresholdTime
Arguments
StorageSize
The storage size, in bytes, of the tag value: -1 = Blob; 0 = Variable length
string; 1 = 1 byte; 2 = 2 byte; 4 = 4 byte; 8 = 8 byte. This value is of data
type int, with no default.
SnapshotSize
The maximum size of the snapshot, in bytes. If this limit is reached, a new
snapshot is created. This value is of data type int, with no default.
ImageTime
The interval, in seconds, between updates to the snapshot file. The
snapshot file is updated with tag value information from the snapshot
buffer, which resides in memory. This value is of data type int, with no
default.
ThresholdTime
The maximum amount of time, in seconds, that can elapse before a new
snapshot is automatically created, provided that the value for the snapshot
size has not been reached. This value is of data type int, with no default.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaSnapshotDetailSelect
aaSnapToSummary
Used by the event system when configuring summary operations.
Syntax
aaSnapToSummary OpKey, Start, End, DateStamp
Arguments
OpKey
An internal variable that identifies the summary operation to perform. This
value is of data type int, with no default.
Start
The starting timestamp for the calculation. This value is of data type
datetime, with no default.
End
The ending timestamp for the calculation. This value is of data type
datetime, with no default.
DateStamp
The time the summary operation was performed. This value is of data type
smalldatetime, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
aaSpaceManager
Used by the system to manage the amount of disk space used to store historical
data for summaries and events.
Syntax
aaSpaceManager
Remarks
This stored procedure is automatically run by the system every ten minutes.
This stored procedure executes the aaDeleteOlderEvents and
aaDelectOlderSummaries stored procedures to clear out old historical data.
The duration for which event and summary history is kept is based on system
parameters stored in the SystemParameter table.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaDeleteOlderEvents
aaDeleteOlderSummaries
aaStorageLocationSelect
Selects a storage location.
Syntax
aaStorageLocationSelect StorageType, StorageNodeKey
Arguments
StorageType
The type of storage used for the specified location. 1 = Circular; 2 =
Alternate; 3 = Buffer; 4 = Permanent. There can only be one storage
location of each type. This value is of data type int, with a default of
NULL.
StorageNodeKey
The unique numerical identifier for the storage node. This value is of data
type int, with a default of 1.
Permission
Execute permission defaults to the public group.
See Also
aaStorageLocationUpdate
aaStorageLocationUpdate
Updates the storage location.
Syntax
aaStorageLocationUpdate StorageType, StorageNodeKey,
SortOrder, Path, MaxMBSize, MinMBThreshold
Arguments
StorageType
The type of storage used for the specified location. 1 = Circular; 2 =
Alternate; 3 = Buffer; 4 = Permanent. There can only be one storage
location of each type. This value is of data type int, with no default.
StorageNodeKey
The unique numerical identifier for the storage node. This value is of data
type int, with no default.
SortOrder
Applies only to the alternate area. If more than one location is defined, the
sort order determines the order in which the alternate areas are used.
Reserved for future use. This value is of data type int, with no default.
Path
The path to the storage location. The circular storage location must be a
local drive on the server machine, and the path must be specified using
normal drive letter notation (for example, c:\InSQL\Data\Circular). The
alternate, buffer, and permanent storage locations can be anywhere on the
network, provided that the ArchestrA service user has full access to those
network locations. For the Windows 2000 operating system, remote
storage locations can be specified either as mapped drives or by using
UNC notation. For the Windows Server 2003 operating system, the
locations must be specified using UNC notation.This value is of data type
nvarchar(255), with no default.
MaxMBSize
The limit, in megabytes, for the amount of data to be stored to the
specified location. The maximum size applies to circular and alternate
storage only. If the maximum size is set to 0, all available space at the
storage location is used. This value is of data type int, with no default.
MinMBThreshold
The minimum amount of disk space, in megabytes, at which the system
attempts to start freeing up space. The threshold applies to circular and
alternate storage only. Typically, you should multiply the size of the
average history block (before any compression) by 1.5 to determine the
minimum threshold. This value is of data type int, with no default.
MaxAgeThreshold
The age, in days, of data that will be deleted by system to free up disk
space. The threshold applies to circular and alternate storage only. The
minimum age is 2 days. A value of 0 indicates that no age threshold is
applied. This value is of data type int, with a default of 0.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaStorageLocationSelect
aaStringTagDelete
Deletes a string tag.
Syntax
aaStringTagDelete wwTagKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with a default of NULL.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaStringTagSelect
aaStringTagUpdate
aaStringTagInsert
aaStringTagInsert
Inserts a string tag.
Syntax
aaStringTagInsert TagName, Description, AcquisitionType,
StorageType, StorageRate, ItemName, TimeDeadband,
CreatedBy, DateCreated, MaxLength, InitialValue,
TopicKey, IOServerKey, CurrentEditor, DoubleByte,
SamplesInActiveImage, ServerTimeStamp, DeadbandType
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server 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.
AcquisitionType
The method by which the tag's value is acquired. If the tag value is
acquired from an I/O Server, specify the name of the I/O Server, topic, and
item. 0 = Not acquired; 1 = Acquired via an I/O Server; 2 = Acquired via
MDAS or a manual update; 3 = System driver. This value is of data type
tinyint, with a default of 1.
StorageType
The type of storage defined for the tag. 0 = Not stored; 1 = Cyclic; 2 =
Delta; 3 = Forced storage; 17 = The storage type has been changed from
cyclic to "not stored." 18 = The storage type has been changed from delta
to "not stored." 19 = The storage type has been changed from "forced" to
"not stored." This value is of data type smallint, with a default of 2.
StorageRate
The rate at which the tag is stored if the storage type is cyclic. The rate is
in milliseconds. This value is of data type int, with a default of 1000.
ItemName
The address string of the tag. This value is of data type nvarchar(256),
with a default of an empty string.
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.
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 datetime, with
a default of NULL.
MaxLength
The maximum number of characters for the string. This value is of data
type smallint, with a default of 131. Valid values are: 8, 16, 24, 32, 48, 64,
128, 131, 256, 512.
InitialValue
The initial value as imported from an external source (for example, from
InTouch). This value is of data type nvarchar(512), with a default of an
empty string.
TopicKey
The unique numerical identifier for the topic. This value is of data type int,
with a default of NULL.
IOServerKey
The unique numerical identifier for the I/O Server. This value is of data
type int, 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 InSQL. 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 Industrial Application
Server (IAS) use IAS as the current editor. If you modify an IAS tag using
the historian Configuration Editor, then the current editor for the tag is
changed to InSQL. However, the next time you redeploy the engine, the
changes are not preserved. 0 = IndustrialSQL Server; 1 = InTouch; 2 =
Application other than IndustrialSQL Server or InTouch. This value is of
data type int, with a default of 0.
DoubleByte
Used to specify whether or not to store the string as a double-byte string. 0
= Not stored as double-byte; 1 = Stored as double-byte. This value is of
data type tinyint, with a default of 0.
SamplesInActiveImage
The number of samples that the active image holds for the tag. 0 indicates
that the active image is using the default of 65 values. The higher the
number of samples, the higher the load on memory resources. This value
is of data type int, with a default of 0.
ServerTimeStamp
Used to specify whether local timestamping by the IndustrialSQL Server
is used. 0 = The IDAS timestamp is used; 1 = The IndustrialSQL Server
time is used for the timestamp. If a fast-changing tag is configured to use
server timestamping, the packet of data that is sent to the storage
subsystem may contain multiple data values with the same timestamp,
which may affect data calculations, such as for swinging door storage.
This value is of data type bit, with a default of 0.
DeadbandType
The type of delta storage deadband to be applied for the tag. This setting is
only in effect if delta storage is configured for the tag. 1= Time and/or
value deadband; 2 = Rate (swinging door) deadband. This value is of data
type smallint, with a default of 1.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaStringTagDelete
aaStringTagSelect
aaStringTagUpdate
aaStringTagSelect
Selects a string tag.
Syntax
aaStringTagSelect wwTagKey
Arguments
wwTagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaStringTagDelete
aaStringTagUpdate
aaStringTagInsert
aaStringTagUpdate
Updates a string tag.
Syntax
aaStringTagUpdate wwTagKey, TagName, Description,
AcquisitionType, StorageType, StorageRate, ItemName,
TimeDeadband, CreatedBy, DateCreated, MaxLength,
InitialValue, TopicKey, IOServerKey, CurrentEditor,
aaSummaryActionInsert
Used by the event subsystem to perform a summary operation for the specified
tag.
Syntax
aaSummaryActionInsert EventTagName, SumDateTime
Arguments
EventTagName
The name of the event tag with which the summary operation is
associated. This value is of data type nvarchar(256), with no default.
SumDateTime
The timestamp to use when storing the result of the calculation. This can
either be the time of when the calculation period starts or the time when it
ends. This value is of data type datetime, with no default.
Permission
Execute permission defaults to the aaAdministrators group.
aaSummaryDetail
Returns summary details for one or more tags that are associated with a
particular summary operation. The type of aggregation for the tag can
optionally be included for each tag that you list.
The starting and ending times are used to specify the time at which the
calculation started/ended for the operation.
Syntax
aaSummaryDetail TagList, StartTime, EndTime, OrderBy
Arguments
TagList
A list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with no default.
StartTime
The starting timestamp for the calculation. This value is of data type
nvarchar(50), with no default.
EndTime
The ending timestamp for the calculation.This value is of data type
nvarchar(50), with no default.
OrderBy
The column by which the results will be ordered. By default, the TagName
column is used. This value is of data type nvarchar(500).
Permission
Execute permission defaults to the public group.
Examples
This example returns the average and miniumum values for 'ReactTemp' and
the maximum value for 'ReactLevel' between 12:12 p.m. and 2:14 p.m. on May
12, 2001. The returned rows are ordered by the date of the summary.
aaSummaryDetail "ReactTemp('AVG','MIN'),
ReactLevel('MAX')", "2001-05-12 12:12:00.000", "2001-
05-12 12:14:00.000", "SummaryDate"
This example returns all aggregate values for 'ReactTemp' and 'ReactLevel'
between 12:12 p.m. and 2:14 p.m. on May 12, 2001.
aaSummaryDetail "ReactTemp, ReactLevel", "2001-05-12
12:12:00.000", "2001-05-12 12:14:00.000"
See Also
aaDetectorStringSelect
aaSummaryOperationDelete
Deletes a summary operation.
Syntax
aaSummaryOperationDelete OperationKey
Arguments
OperationKey
The unique numerical identifier for the summary operation. This value is
of data type int, with no default.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaSummaryOperationUpdate
aaSummaryOperationSelect
aaSummaryOperationInsert
aaSummaryOperationInsert
Inserts a summary operation that will be associated with the specified event
tag.
Syntax
aaSummaryOperationInsert TagName, CalcType, Duration,
Resolution, TimeStamp, Description
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
CalcType
The type of calculation to be performed: SUM, MAX, MIN, or AVG. This
value is of dataype char(3), with no default.
Duration
The period, in seconds, for which the calculation is performed. This value
is of data type real, with no default.
Resolution
The sampling rate, in milliseconds, for retrieving the data in cyclic mode.
The system returns values stored over the requested time period at the
interval specified by the resolution. For example, if you specify a 5000 ms
resolution, the system queries for all data during the time period and then
only returns those values that occur at each 5000 ms interval, starting with
the start date and ending with the end date. This value is of data type int,
with no default.
TimeStamp
The timestamp to use when storing the result of the calculation. This can
either be the time of when the calculation period starts or the time when it
ends.0 = Beginning of the calculation period; 1 = End of the calculation
period. This value is of data type tinyint, with no default.
Description
The description of the summary operation. This value is of data type
nvarchar(50), with a default of NULL.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaSummaryOperationDelete
aaSummaryOperationSelect
aaSummaryOperationUpdate
aaSummaryOperationSelect
Selects a summary operation.
Syntax
aaSummaryOperationSelect EventTagName, CalcType, Duration,
Resolution, TimeStamp
Arguments
EventTagName
The name of the event tag with which the summary operation is
associated. This value is of data type nvarchar(256), with a default of
NULL.
The remaining arguments are the same as for the
aaSummaryOperationInsert stored procedure. However, all of the arguments
have a default of NULL.
Remarks
The arguments of this stored procedure is used in three ways: (1) if no
arguments are specified, all summary operations will be returned; (2) if the
EventTagName argument is specified, all summary operations for that event
tag will be returned; (3) if all arguments are specified, only the summary
operation that matches the criteria will be returned.
Permission
Execute permission defaults to the public group.
See Also
aaSummaryOperationUpdate
aaSummaryOperationDelete
aaSummaryOperationInsert
aaSummaryOperationUpdate
Updates the summary operation that is associated with a specified event tag.
Syntax
aaSummaryOperationUpdate OperationKey, TagName, CalcType,
Duration, Resolution, TimeStamp, Description
Arguments
OperationKey
The unique numerical identifier for the summary operation. This value is
of data type int, with no default.
The remaining arguments are the same as for the
aaSummaryOperationInsert stored procedure. However, only the
Description argument has a default.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaSummaryOperationDelete
aaSummaryOperationSelect
aaSummaryOperationInsert
aaSummaryTagListDelete
Deletes summary information for a tag.
Syntax
aaSummaryTagListDelete SumVarKey
Arguments
SumVarKey
The unique numerical identifier for a summarized tag. This value is of data
type int, with no default.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaSummaryTagListSelect
aaSummaryTagListUpdate
aaSummaryTagListInsert
aaSummaryTagListInsert
Inserts summary information for a specified tag.
Syntax
aaSummaryTagListInsert TagName, OperationKey, LowerLimit,
UpperLimit, Description
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
OperationKey
The unique numerical identifier for the summary operation. This value is
of data type int, with no default.
LowerLimit
The lower limit of validity for the tag's value. Values lower than this limit
are not used in the calculation. By default, this value is set to
-1000000000. This value is of data type real, with a default of NULL.
UpperLimit
The upper limit of validity for the tag's value. Values higher than this limit
are not used in the calculation. By default, this value is set to 1000000000.
This value is of data type real, with a default of NULL.
Description
The description of the summarized tag. This normally describes the result
of the operation, although this description can be the same as that of the
tag on which the operation is performed. This value is of data type
nvarchar(50), with a default of NULL.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaSummaryTagListDelete
aaSummaryTagListSelect
aaSummaryTagListUpdate
aaSummaryTagListSelect
Selects summary information for a tag.
Syntax
aaSummaryTagListSelect OperationKey, TagName
Arguments
OperationKey
The unique numerical identifier for the summary operation. This value is
of data type int, with no default.
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaSummaryTagListDelete
aaSummaryTagListUpdate
aaSummaryTagListInsert
aaSummaryTagListUpdate
Updates summary information for a specified tag.
Syntax
aaSummaryTagListUpdate SumVarKey, TagName, OperationKey,
LowerLimit, UpperLimit, Description
Arguments
SumVarKey
The unique numerical identifier for a summarized tag. This value is of data
type int, with no default.
The remaining arguments are the same as for the aaSummaryTagListInsert
stored procedure.
Permission
Execute permission defaults to the aaAdministrators group.
See Also
aaSummaryTagListDelete
aaSummaryTagListSelect
aaSummaryTagListInsert
aaSystemConfigNSExpand
Expands the tree view under a single object in the system namespace. This
stored procedure is used by the System Management Console.
Syntax
aaSystemNSExpand PKey, FKey1, FKey2, FKey3, TokenType,
FilterStr
Arguments
PKey
A local variable used to identify the object in the namespace.This value is
of data type int, with no default.
FKey1-FKey3
A local variable used to determine the position of the object in the tree
view. This value is of data type int, with no default.
TokenType
The type of system namespace group. 1000010 = Data Acquisition;
1000017 = System Driver; 1000018 = IDASs; 1000019 = I/O Servers.
This value is of data type int, with no default.
FilterStr
Used to order the tagnames in the namespace. This value is of data type
nvarchar(100), with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSExpand
aaPublicNSExpand
aaSystemNSExpand
Expands the tree view under a single object in the system namespace.
Syntax
aaSystemNSExpand PKey, FKey1, FKey2, FKey3, TokenType,
FilterStr
Arguments
PKey
A local variable used to identify the object in the namespace.This value is
of data type int, with no default.
FKey1-FKey3
A local variable used to determine the position of the object in the tree
view. This value is of data type int, with no default.
TokenType
The type of system namespace group. 1000010 = Data Acquisition;
1000017 = System Driver; 1000018 = IDASs; 1000019 = I/O Servers.
This value is of data type int, with no default.
FilterStr
Used to order the tagnames in the namespace. This value is of data type
nvarchar(100), with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSExpand
aaPublicNSExpand
aaSystemNSExpand2
Expands the tree view under a single object in the system namespace.
Syntax
aaSystemNSExpand2 PKey, FilterStr
Arguments
PKey
A local variable used to identify the object in the namespace. This value is
of data type int, with no default.
FilterStr
Used to order the tagnames in the namespace. This value is of data type
nvarchar(100), with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaPrivateNSExpand
aaPublicNSExpand
aaSystemParameterSelect
Returns details for a specified system parameter, such as a description of the
parameter, the current value, and so on. If you do not specify a name, the stored
procedure returns details for all defined system parameters.
Syntax
aaSystemParameterSelect name
Arguments
Name
The unique name for the system parameter. This value is of data type
nvarchar(50), with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaSystemParameterUpdate
aaSystemParameterUpdate
Updates the value and description for a specified system parameter. If you do
not provide a description, the previous description is used.
Syntax
aaSystemParameterUpdate Name, Value, Description
Arguments
Name
The unique name for the system parameter. This value is of data type
nvarchar(50), with no default.
Value
The value of the system parameter. This value is of data type sql_variant,
with no default.
Description
The description of the system parameter. This value is nvarchar(255), with
a default of NULL.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaSystemParameterSelect
aaTagConfig
Used by the internal Configuration Manager when the IndustrialSQL Server
historian starts.
Syntax
aaTagConfig
Remarks
This stored procedure takes a snapshot of the system configuration at the tag
level.
Permission
Execute permission defaults to the public group.
See Also
aaTagConfigModified
aaTagConfigSelect
aaTagConfigModified
Used by the internal configuration object.
Syntax
aaTagConfigModified
Remarks
This stored procedure has the same functionality as the aaTagConfig stored
procedure, but only retrieves the database modifications pending when a
commit of changes is performed.
Permission
Execute permission defaults to the public group.
See Also
aaTagConfig
aaTagConfigSelect
aaTagConfigSelect
Used by the System Management Console to return a list of tags associated
with a particular engineering unit (for analog tags) or message (for discrete
tags).
Syntax
aaTagConfigSelect, TagType, Key, FilterStr
Arguments
TagType
The type of tag to retrieve. 1 = Analog; 2 = Discrete. This value is of data
type int, with no default.
Key
The database key value for the relevant type, either the message key or the
engineering unit key. This value is of data type int, with no default.
FilterStr
Used to order the tagnames in the namespace. This value is of data type
nvarchar(100), with a default of N%.
Permission
Execute permission defaults to public group.
See Also
aaTagConfigModified
aaTagConfig
aaTagInfo
Returns definition information for each specified tag.
Syntax
aaTagInfo TagList
Arguments
TagList
A list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with no default.
Permission
Execute permission defaults to the public group.
aaTagType
Returns the tag type for each specified tag.
Syntax
aaTagType TagList
Arguments
TagList
A list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with no default.
Permission
Execute permission defaults to the public group.
aaTimeDetectorDetailInsert
Inserts time detector details that are associated with a specified event tag.
Syntax
aaTimeDetectorDetailInsert FrequencyID, TagName,
Periodicity, StartDateTime, RunTimeDay, RunTimeHour,
RunTimeMin
Arguments
FrequencyID
The unique numerical identifier for the frequency. Used to link a
frequency with a time-based detector. 1= Hourly; 2 = Daily; 3 = Weekly; 4
= Monthly; 5 = Periodic; 6 = Other (Reserved for future use). This value is
of data type int, with no default.
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with no default.
Periodicity
The interval period in minutes between detector events. Only used for a
periodic detection. This value is of data type int, with no default.
StartDateTime
The timestamp from which the time detector starts. Only used for a
periodic detection. This value is of data type datetime, with no default.
RunTimeDay
In the context of a weekly detector, RunTimeDay maps the week day
number (0 = Sunday – 6 = Saturday). In the context of a monthly detector,
RunTimeDay maps to the day of the month. Not used for periodic
detections. This value is of data type tinyint, with no default.
RunTimeHour
The hour of the day at which the time detector triggers. Not used for
periodic detections. This value is of data type tinyint, with no default.
RunTimeMin
The minute of the hour at which the time detector triggers. Not used for
periodic detections. This value is of data type tinyint, with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaTimeDetectorDetailSelect
aaTimeDetectorDetailUpdate
aaTimeDetectorDetailSelect
Selects the time detector from the TimeDetectorDetail table that is associated
with the specified event tag.
Syntax
aaTimeDetectorDetailSelect TagName
Arguments
TagName
The unique name of the tag within the IndustrialSQL Server system.This
value is of data type nvarchar(256), with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaTimeDetectorDetailInsert
aaTimeDetectorDetailUpdate
aaTimeDetectorDetailUpdate
Updates the time detector in the TimeDetectorDetail table that is associated
with the specified event tag.
Syntax
aaTimeDetectorDetailUpdate FrequencyID, TagName,
Periodicity, StartDateTime, RunTimeDay, RunTimeHour,
RunTimeMin
Arguments
The arguments are the same as for the aaTimeDetectorDetailUpdate stored
procedure. However, none of the arguments have defaults.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaTimeDetectorDetailSelect
aaTimeDetectorDetailInsert
aaTopicDelete
Deletes an I/O topic.
Syntax
aaTopicDelete TopicKey
Arguments
TopicKey
The unique numerical identifier for the topic. This value is of data type int,
with no default.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaTopicUpdate
aaTopicSelect
aaTopicInsert
aaTopicInsert
Inserts an I/O topic.
Syntax
aaTopicInsert StorageNodeKey, IOServerKey, Name, TimeOut,
LateData, IdleDuration, ProcessingInterval
Arguments
StorageNodeKey
The unique numerical identifier for the storage node. This value is of data
type int, with no default.
IOServerKey
The unique numerical identifier for the I/O Server. This value is of data
type int, with no default.
Name
The name of the topic. This value is of data type nvarchar(80), with no
default.
TimeOut
The time span, in milliseconds, in which a data point must be received on
the topic. If no data point is received in this time span, the topic is
considered "dead." The historian disconnects and then attempts to
reconnect to the topic. This value is of data type int, with a default of
60000.
LateData
Used to enable acquisition of "late" data. 0 = Late data disabled; 1 = Late
data enabled. This value is of data type bit, with a default of 0.
IdleDuration
The amount of time, in seconds, before data is processed from the I/O
Server. For example, if you set this value to 60 seconds, data from this I/O
Server is cached and only processed by the storage engine after no more
data has been received from the I/O Server for at least 60 seconds. This
value is of data type int, with a default of 60.
ProcessingInterval
The amount of time, in seconds, after which late data from the I/O Server
is processed, regardless of the idle duration. If the nature of the data is
such that the idle duration is never satisfied, the historian storage engine
processes data from the topic at least one time every processing interval.
The processing interval defaults to twice the idle duration and cannot be
set to a value less than the idle duration. This value is of data type int, with
a default of 120.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaTopicDelete
aaTopicSelect
aaTopicUpdate
aaTopicSelect
Selects an I/O topic.
Syntax
aaTopicSelect TopicKey
Arguments
TopicKey
The unique numerical identifier for the topic. This value is of data type int,
with a default of NULL.
Permission
Execute permission defaults to the public group.
See Also
aaTopicUpdate
aaTopicDelete
aaTopicInsert
aaTopicUpdate
Updates an I/O topic.
Syntax
aaTopicUpdate TopicKey, StorageNodeKey, IOServerKey, Name,
TimeOut, LateData, IdleDuration, ProcessingInterval
Arguments
TopicKey
The unique numerical identifier for the topic. This value is of data type int,
with no default.
The remaining arguments are the same as for the aaTopicInsert stored
procedure. However, only the TimeOut, LateData, IdleDuration, and
ProcessingInterval arguments have defaults.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaTopicDelete
aaTopicSelect
aaTopicInsert
aaUpdateCalculatedAISamples
Used by the system to write the optimum number of samples in the active
image to the CalculatedAISamples column in the Tag table. This stored
procedure is used by the IndustrialSQL Server historian and should not be
executed by users.
Syntax
aaSetCalculatedAISamples TagKey, Samples
TagKey
The unique numerical identifier for the tag within a single IndustrialSQL
Server. This value is of data type int, with no default.
Samples
The number of samples that the active image holds for the tag. 0 indicates
that the active image is using the default of 65 values. The higher the
number of samples, the higher the load on memory resources. This value
is of data type int, with no default.
Remarks
If the AIAutoResize system parameter is set to 1, the system continuously
recalculates the optimum number of samples for each tag based on the data
rates received. If the calculated value exceeds the current value in the database,
then the system updates the CalculatedAISamples column in the Tag table.
Permission
Execute permission defaults to the aaPowerUsers and aaAdministrators
groups.
See Also
aaSetAISamples
aaSetCalculatedAISamples
aaUserAccessLevelSelect
Returns the access level associated with the currently logged on user. Access
levels are: 1 = Undefined IndustrialSQL user (for example, public); 2 = User
(hUser permissions); 3 = PowerUser (hPowerUser permission); 3 = Admin
(hAdmin permissions); 9999 = dbo.
Syntax
aaUserAccessLevelSelect
Remarks
The access level values correspond to values in the UserDetail table, which is
populated during installation.
Permission
Execute permission defaults to the public group.
aaUserDetailUpdate
Allows the UserDetail table to be populated from information contained in the
sysusers table.
Syntax
aaUserDetailUpdate
Permission
Execute permission defaults to the aaAdministrators group.
xp_AnalogHistory
Returns data from the AnalogHistory table.
Syntax
xp_AnalogHistory StartTime, EndTime, Resolution, Tag1
[,Tag2,...]
xp_AnalogHistoryDelta
Returns a row from the AnalogHistory table for each instance where a stored
analog value changed (delta retrieval).
Syntax
xp_AnalogHistoryDelta StartTime, EndTime, MaxRowCount,
Tag1 [,Tag2,...]
xp_AnalogWideHistory
Returns data from the AnalogWideHistory table. Each row returned contains a
value in each column for each tag's value at a specified time.
Syntax
xp_AnalogWideHistory StartTime, EndTime, Resolution, Tag1
[,Tag2,...]
xp_AnalogWideHistoryDelta
Returns data from the AnalogWideHistory table for each instance where a
stored analog value changed (delta retrieval). Each row returned contains a
value in each column for each tag's value at a specified time.
Syntax
xp_AnalogWideHistoryDelta StartTime, EndTime, MaxRowCount,
Tag1 [,Tag2,...]
xp_DiscreteHistory
Returns data from the DiscreteHistory table.
Syntax
xp_DiscreteHistory StartTime, EndTime, Resolution, Tag1
[,Tag2,...]
xp_DiscreteHistoryDelta
Returns a row from the DiscreteHistory table for each instance where a stored
discrete value changed (delta retrieval).
Syntax
xp_DiscreteHistoryDelta StartTime, EndTime, MaxRowCount,
Tag1 [,Tag2,...]
xp_DiscreteWideHistory
Returns data from the DiscreteWideHistory table. Each row returned contains a
value in each column for each tag's value at a specified time.
Syntax
xp_DiscreteWideHistory StartTime, EndTime, Resolution,
Tag1 [,Tag2,...]
xp_DiscreteWideHistoryDelta
Returns data from the DiscreteWideHistory table for each instance where a
stored discrete value changed (delta retrieval). Each row returned contains a
value in each column for each tag's value at a specified time.
Syntax
xp_DiscreteWideHistoryDelta StartTime, EndTime,
MaxRowCount, Tag1 [,Tag2,...]
xp_DiskCopy
Copies history blocks or a subset of history blocks to the "archive" historical
path (permanent path).
Syntax
xp_DiskCopy StartTime, EndTime, Description
Parameters
For more information on the parameters, see "Extended Stored Procedure
Arguments" on page 176.
Remarks
The xp_DiskCopy extended stored procedure will not allow a history block to
be copied if the time range specified is already archived in permanent storage.
You must first delete the archived block(s) that falls within the specified time
range before performing the block copy. This prevents overwriting the
archived block with a newer block that has had old data inserted with the same
timestamps as the already archived data.
Example
For example:
xp_DiskCopy "20010220 13:10:00:000", "20010220
14:00:00:000", "Plant trip 02/20/2001"
xp_NewHistoryBlock
Stops data from being written to the current history block and starts a new one.
This process will take approximately 10 minutes, but no data is lost. The
system acts the same as if it were a scheduled block changeover.
Syntax
xp_NewHistoryBlock
Remarks
When this extended stored procedure is executed, a message will be logged to
the message log file as for a regular block changeover. However, if executed
manually in SQL Server Query Analyzer, a message will also appear in the
Results section if the execution was successful. To verify that the block
changeover actually occurred, you must still check in the System Management
Console message log. For more information, see "Monitoring System
Messages" in Chapter 9, "Monitoring the System," in your IndustrialSQL
Server™ Historian Administration Guide.
xp_ProcList
Returns syntax details for all of the extended stored procedures for the
IndustrialSQL Server historian that exist on the Microsoft SQL Server.
Syntax
xp_ProcList
xp_RescanHistoryBlocks
Refreshes the system with any history block changes since the last scan.
Syntax
xp_RescanHistoryBlocks
xp_SetStorageTimeDeadband
Sets the storage time deadband for one or more tags while the IndustrialSQL
Server historian is running.
Syntax
xp_SetStorageTimeDeadband <TimeDeadband>, <Tag1> [,
<Tag2>,...]
Arguments
For more information on the parameters, see "Extended Stored Procedure
Arguments" on page 176.
Remarks
The xp_SetStorageTimeDeadband extended stored procedure is a server
function that will modify the delta storage rule for the specified tag. It does not
update the database and is valid until the server is restarted.
Example
This example sets the storage time deadband to 2000 milliseconds for the
analog tag "BoilerTag:"
xp_SetStorageTimeDeadband 2000, 'BoilerTag'
xp_SetStorageValueDeadband
Sets the storage value deadband for one or more tags while the IndustrialSQL
Server historian is running.
Syntax
xp_SetStorageValueDeadband <ValueDeadband>, <Tag1> [,
<Tag2>,...]
Arguments
For more information on the parameters, see "Extended Stored Procedure
Arguments" on page 176.
Remarks
The xp_SetStorageValueDeadband extended stored procedure is a server
function that will modify the delta storage rule for the specified tag. It does not
update the database and is valid until the server is restarted.
Example
This example sets the storage value deadband to 5 percent of the engineering
unit range for the analog tag "BoilerTag:"
xp_SetStorageValueDeadband 5, 'BoilerTag'
xp_SetStoreForwardEvent
Starts store-and-forward data processing on the IndustrialSQL Server
historian.
Syntax
xp_SetStoreForwardEvent
Remarks
This extended stored procedure is useful if you have manually copied store-
and-forward blocks from the IDAS computer to the historian computer.
Description
The description of the history data that will be copied.
TagN
Tag1, Tag2… TagN are tagname values. Each tagname must be comma
delimited and can optionally be surrounded with quotes. For example:
GetDate() Expressions
Date/time values can have a string value expression containing the string
"GetDate". This is not the same as the SQL Server GetDate() function,
although the effect is the same. Example expressions are:
GetDate
"GetDate"
"GetDate()"
For example:
exec xp_AnalogHistory GetDate, "GetDate()", 1000,
'SysTimeSec'
DateAdd(...) Expressions
Date/time values can have a string value expression containing the string
"DateAdd(…)". This is not the same as the SQL Server DateAdd() function,
although the effect is very similar.
Syntax
"DATEADD (datepart, number, date)"
Parameters
DatePart
Specifies on which part of the date to return a new value. The following
table lists the date parts and abbreviations recognized by the extended
stored procedures for the IndustrialSQL Server historian.
MILLISECOND MS
SECOND SS
MINUTE MI
HOUR HH
DAY DD
WEEKDAY DW
WEEK WK
DAYOFYEAR DY
MONTH MM
QUARTER QQ
YEAR YY
Number
The value used to increment datepart. If you specify a value that is not an
integer, the fractional part of the value is discarded. For example, if you
specify day for datepart and 1.75 for number, date is incremented by 1.
Date
Either a literal date value without quotes (see "Literal Date Expressions"
on page 177) or a GetDate() expression also without quotes (see
"GetDate() Expressions" on page 177).
Example Expressions
"DateAdd(HOUR, -1, GetDate())"
"DateAdd(MINUTE, -30, 4/2/2001 13:00:00:00)"
Extended Stored Procedure Date Expression Examples
xp_DiscreteHistory "DateAdd(HOUR, -1, GetDate())",
"GetDate()", 1000, 'SysPulse'
xp_DiscreteHistoryDelta "DateAdd(DAY, -1, 4/2/2001)",
"GetDate()", 100, 'SysPulse'
xp_AllowCommit
Determines whether a dynamic reconfiguration can be committed. Used by the
aaCommitChanges stored procedure when a dynamic reconfiguration is
requested.
Syntax
xp_AllowCommit AllowCommit
Arguments
AllowCommit
A single output parameter provided by the system.
Return Values
Value Description
0 OK to commit.
1 The system is not running or has not been started. The
commit request will be ignored and clean up the
ConfigStatusPending table cleaned up.
2 Cannot commit; history block in progress.
4 Cannot commit; dynamic reconfiguration in progress.
128 Cannot commit; reason unknown.
xp_TZgetdate
Returns the correct date/time for the time zone specified. Used by the
faaTZgetdate function.
Syntax
xp_TZgetdate wwTimeZone
Argument
wwTimeZone
Time zone for which to return the date/time.
Return Value
DateTime
The correct date/time for the requested time zone.
xp_SetAutoStart
Sets the InSQLConfiguration service startup type parameter to "Automatic."
Syntax
xp_SetAutoStart
Remarks
This extended stored procedure configures the InSQLConfiguration service. In
order for the InSQLConfiguration service to start up the rest of the
IndustrialSQL Server historian, the AutoStart system parameter must be set to
1. For more information, see "System Parameters" in Chapter 2, "System-
Level Functionality," in your IndustrialSQL Server™ Historian Concepts
Guide.
• aaInternalMDASDiscreteTagInsert
• aaInternalMDASDiscreteTagUpdate
• aaInternalMDASStringTagInsert
• aaInternalMDASStringTagUpdate
• aaInternalMessageExport
• aaInternalMessageImport
• aaInternalNSAreaUpdate
• aaInternalNSObjectPopulate
• aaInternalNSObjectUpdate
• aaInternalObjectDataInsert
• aaInternalSetServerName
• aaInternalSnapshotTagExport
• aaInternalSnapshotTagImport
• aaInternalStringTagExport
• aaInternalStringTagImport
• aaInternalSummaryOperationExport
• aaInternalSummaryOperationImport
• aaInternalSummaryTagExport
• aaInternalSummaryTagImport
• aaInternalTagDetails
• aaInternalTopicExport
• aaInternalTopicImport
For example, the following query creates a stored procedure that returns the
timestamp and value for the tag 'ReactLevel" for the last 15 minutes.
CREATE PROCedure MyProc
AS
SELECT DateTime, TagName, Value
FROM History
WHERE TagName = 'ReactLevel'
AND DateTime >= DATEADD(mi, -15, GETDATE())
AND DateTime <= GETDATE()
C H A P T E R 5
User-Defined Functions
Contents
• faaCheckLicenseViolation
• faaContainedName
• faaGetLocalizedText
• faaLicensedTagDetails
• faaLicensedTagTotal
• faaObjectTagName
• faaTagsInLicenseViolation
• faaTZgetdate
• faaUser_ID
faaCheckLicenseViolation
Checks to see if the total number of tags in the IndustrialSQL Server historian
is less than or equal to the number allowed by the current license.
Syntax
SELECT dbo.faaCheckLicenseViolation()
Return Type
Integer.
Remarks
If the total number of tags in the system is below the amount allowed, the result
of this function will be 0. If not, the number of tags that exceed the allocated
amount will be returned. For example, if a system has 100 tags, but the license
only allows for 60, a value of 40 will be returned.
See Also
faaLicensedTagDetails
faaLicensedTagTotal
faaTagsInLicenseViolation
faaContainedName
Given a string in the form of "TagName [ ContainedName ]," returns the
ContainedName.
Syntax
SELECT dbo.faaContainedName(DisplayName)
Arguments
DisplayName
The name as it appears in the model view hierarchy. The display name
format is: TagName [ ContainedName ].
Return Type
Nvarchar(255).
Remarks
The maximum number of characters for both the display name and the returned
contained name is 255.
See Also
faaObjectTagName
faaGetLocalizedText
Returns the strings from the LocalizedText table for the requested language. If
the specified translation is not found, English strings are returned.
Syntax
SELECT * FROM dbo.faaGetLocalizedText(LangID)
Arguments
LangID
The locale ID for the language used. This ID is also used in the SQL
Server syslanguages table.
Table Returned
The results are returned as a table that has the same columns as the
LocalizedText table. However, the returned table will only include those rows
containing strings in the specified language.
faaLicensedTagDetails
Returns the total number of tags and the number of licensed tags in the system,
as well as for each tag type.
Syntax
SELECT * FROM dbo.faaLicensedTagDetails()
Table Returned
The result is returned in a table format. For example:
Remarks
System tags and event tags are not included in the total tag count for licensing
purposes.
See Also
faaCheckLicenseViolation
faaLicensedTagTotal
faaTagsInLicenseViolation
faaLicensedTagTotal
Returns the total number of tags in the system for the specified tag type or for
all tags.
Syntax
SELECT dbo.faaLicensedTagTotal(TagType)
Arguments
TagType
The type of tag. 1 = Analog; 2 = Discrete; 3 = String; 4 = Complex; 0 = All
tags.
Return Type
Integer.
Remarks
System tags and event tags are not included in the total tag count for licensing
purposes.
See Also
faaCheckLicenseViolation
faaLicensedTagDetails
faaTagsInLicenseViolation
faaObjectTagName
Given a string in the form of "TagName [ ContainedName ]," returns the
Tagname.
Syntax
SELECT dbo.faaObjectTagName(DisplayName)
Arguments
DisplayName
The name as it appears in the model view hierarchy. The display name
format is: TagName [ ContainedName ].
Return Type
Nvarchar(255).
Remarks
The maximum number of characters for both the display name and the returned
tagname is 255.
See Also
faaContainedName
faaTagsInLicenseViolation
Returns information about tags that have been disabled due to violation of the
licensed tag count. The information is returned in a table format.
Syntax
SELECT * FROM dbo.faaTagsInLicenseViolation()
Table Returned
Remarks
If the licensed tag count has been exceeded, the historian will disable enough
tags to run with the allowed licensed tag count. To determine the tags that are
in violation of the license, the system first generates the total number of
analog, discrete, complex, and string tags. (System and event tags are not
included in the total tag count for licensing.) If the total number of tags exceeds
the number allowed by the license, the most recent tag additions to the system
are disabled. The most recent additions are indicated by the wwTagKey
column of the Tag table; the higher the number, the more recent the addition.
See Also
faaCheckLicenseViolation
faaLicensedTagDetails
faaLicensedTagTotal
faaTZgetdate
Returns the date/time, in the appropriate time zone.
Syntax
SELECT dbo.faaTZgetdate(TimeZone)
Arguments
TimeZone
The name of the time zone.
Return Type
DateTime.
Remarks
Use this function instead of the SQL GetDate() function to specify a time zone
other than the server time zone in a query. To retrieve data in the time zone of
the server, just use the SQL GetDate() function.
Example
DECLARE @starttime datetime
faaUser_ID
Returns the database user ID (in the Runtime database) for the current user, if
the user has an individual login. Returns the database ID of the appropriate
Windows security group, if the current user is a group member and does have
an individual login (that is, the current user logs in by virtue of being a member
of the Windows group).
Syntax
SELECT dbo.faaUserID()
Return Type
Integer.
Remarks
This function is used for processing annotations and for support of private
namespaces.
• If a user has his or her own database login, he or she has a completely
private namespace and private annotations.
• If the user is part of a Windows security group, and logs in only by virtue
of being part of the group, the private namespace and annotations are
shared with all members of that group.
This stored procedure assumes that Windows users that are logged in are only
members of a single Windows group (configured in SQL Server). If a user is
found in more than one group, the ID of the last group found is used. This
could be a problem if you are expecting a given user to have access to a
particular private group.
Also, it is possible that annotations and namespace entries are created under
names that you might not expect. For example, a user is a local administrator
on a computer, and his/her login has also been added to the aaUsers local
group. When logging in to SQL Server, the user will be mapped to the
sysadmin fixed server role, by virtue of his/her membership in the
BUILTIN\Administrators group. (This assumes that the
BUILTIN\Administrators login has not been modified or disabled for security
reasons). If this user creates annotations or private namespace entries, these
appear as if they had been created by "dbo," rather than by a member of the
local aaUsers group.
C H A P T E R 6
Backward Compatibility
Entities
Some entities are included in the database for backward compatibility support
only. It is recommended that you begin to discontinue the use of these entities.
Contents
• Backward Compatibility Views
• Backward Compatibility Tables
• Backward Compatibility Stored Procedures
• Backward Compatibility Functions
Note The history tables that are listed in the SQL Server Enterprise Manager
under the Tables tree item for the Runtime database (for example,
History_OLEDB) are simply definitions for the OLE DB provider to use; no
data is stored in them. The extension tables that actually provide data to clients
are listed for the INSQL or INSQLD linked servers under the Security tree
item.
Summary Views
The summary views allow you to query for data that was summarized by the
event subsystem. Each of the views contains data for a specific source,
frequency, and operation.
NamedSystemParameter
Contains one row for each system parameter. This view provides backward
compatibility support for the NamedSystemParameter table, which has been
replaced by the SystemParameter table.
SystemNameSpace
Contains one row for each item in a single system namespace. Items in the
system namespace include servers, topics, users, and so on, and are organized
in a hierarchy. This view provides backward compatibility support for the
SystemNameSpace table, which has been deleted.
InSQLSysObjects
Contains one row for each object in the database for which changes can be
tracked.This view provides backward compatibility support for the
InSQLSysObjects table, which has been renamed to HistorianSysObjects
v_ErrorLog
Contains one row for each system message (error message), if this
functionality was enabled. By default, this table is not used. For more
information, see Chapter 9, "Monitoring the System," in your IndustrialSQL
Server™ Historian Administration Guide.
• DiscreteWideHistory
• GroupTagList
• ManualAnalogHistory
• ManualDiscreteHistory
• ManualStringHistory
• NameSpaceIcons
• StringHistory (INSQL.Runtime.dbo.StringHistory)
• StringLive (INSQL.Runtime.dbo.StringLive)
• StringWideHistory
• TagGroup
• WideTableDictionary
AnalogHistory
(INSQL.Runtime.dbo.AnalogHistory)
This table has been superceded by the History table. For descriptions of
columns in this table, see "History (INSQL.Runtime.dbo.History)" on page 38.
AnalogLive (INSQL.Runtime.dbo.AnalogLive)
This table has been superceded by the Live table. For descriptions of columns
in this table, see "Live (INSQL.Runtime.dbo.Live)" on page 50.
AnalogWideHistory
This table has been superceded by the WideHistory table. In a query, this table
must be referenced using an OPENQUERY statement. For descriptions of
columns in this table, see "WideHistory (INSQL.Runtime.dbo.WideHistory)"
on page 77.
ComplexHistory
Contains one row for each stored complex tag over time. Complex tags include
BLOBs such as arrays, .AVI files, bitmaps, and so on. The ComplexHistory
table is not automatically populated by the system, but rather by a client
application. The ComplexHistory table is a normal SQL Server table.
Note Complex tags are currently not supported. BLOBs are stored as strings.
ComplexTag
Contains one row for each defined complex tag. Configuration information
particular to complex tags is stored in this table, while general information for
all tag types is stored in the Tag table. A complex tag is any type of tag data
other than analogs, discretes, or strings. Examples are arrays and video.
Note Complex tags are currently not supported. BLOBs are stored as strings.
DiscreteHistory
(INSQL.Runtime.dbo.DiscreteHistory)
This table has been superceded by the History table. For descriptions of
columns in this table, see "History (INSQL.Runtime.dbo.History)" on page 38.
DiscreteLive (INSQL.Runtime.dbo.DiscreteLive)
This table has been superceded by the Live table. For descriptions of columns
in this table, see "Live (INSQL.Runtime.dbo.Live)" on page 50.
DiscreteWideHistory
This table has been superceded by the WideHistory_OLEDB table. In a query,
this table must be referenced using an OPENQUERY statement. For
descriptions of columns in this table, see "WideHistory
(INSQL.Runtime.dbo.WideHistory)" on page 77.
GroupTagList
Contains one row for each defined group of tags.
ManualAnalogHistory
This table can be used by custom client applications to store values for analog
tags. By default, this table is empty. If written to by a client application, this
table will contain one row for each defined analog tag per sample period.
ManualAnalogHistory is a normal SQL Server table and does not support any
of the Industrial SQL Server extensions for handling data.
ManualDiscreteHistory
This table can be used by custom client applications to store values for discrete
tags. By default, this table is empty. If written to by a client application, this
table will contain one row for each defined discrete tag per sample period.
ManualDiscreteHistory is a normal SQL Server table and does not support any
of the Industrial SQL Server extensions for handling data.
ManualStringHistory
This table can be used by custom client applications to store values for string
tags. By default, this table is empty. If written to by a client application, this
table will contain one row for each defined string tag per sample period.
ManualStringHistory is a normal SQL Server table and does not support any of
the Industrial SQL Server extensions for handling data.
Note Data that was stored in the StringHistory table prior to the
IndustrialSQL Server 8.0 historian will be automatically migrated into this
table during IndustrialSQL Server 8.0 (or later) historian installation.
NameSpaceIcons
Contains one row for each defined namespace icon. Namespace icons can be
shown in an application browser for each level of the namespace (system,
public, and private).
StringHistory (INSQL.Runtime.dbo.StringHistory)
This table has been superceded by the History table. For descriptions of
columns in this table, see "HistorianSysObjects" on page 38.
StringLive (INSQL.Runtime.dbo.StringLive)
This table has been superceded by the Live table. For descriptions of columns
in this table, see "Live (INSQL.Runtime.dbo.Live)" on page 50.
StringWideHistory
This table was implemented for completeness. However, you should use the
WideHistory table instead of this table. In a query, this table must be
referenced using an OPENQUERY statement. For descriptions of columns in
this table, see "WideHistory (INSQL.Runtime.dbo.WideHistory)" on page 77.
TagGroup
Contains one row for each defined tag group. A tag group is a simple, non-
hierarchical grouping of tags that can be used by the system.
WideTableDictionary
Contains one row of values for up to 249 tags. These 249 tags appear as
columns that will be visible in the data dictionary for each user. Mainly used by
ad-hoc query tools. Does not affect the ability to access the values stored for a
tag. .
Renamed Tables
The following table has been renamed. A view named InSQLSysObjects has
been created for backward compatibility.
aaAnalogDetail
Returns information about one or more specified analog tags, including the
name of the tag, a description, the acquisition rate, the engineering unit, and
the minimum and maximum values in engineering units.
Syntax
aaAnalogDetail TagList
Arguments
TagList
A list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with no default.
Permission
Execute permission defaults to the public group.
See Also
aaDiscreteDetail
aaStringDetail
aaDiscreteDetail
Returns information about one or more specified discrete tags, including the
name of the tag, a description, the message for the TRUE (1) state of the tag,
and the message for the FALSE (0) state of the tag.
Syntax
aaDescreteDetail TagList
Arguments
TagList
A list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with no default.
Permission
Execute permission defaults to the public group.
See Also
aaAnalogDetail
aaStringDetail
aaStringDetail
Returns a description for one or more specified tags.
Syntax
aaStringDetail TagList
Arguments
TagList
A list of tags delimited by a comma (,). This value is of data type
nvarchar(4000), with no default.
Permission
Execute permission defaults to the public group.
See Also
aaAnalogDetail
aaDiscreteDetail
ww_CheckClientVersion
Checks which version of the client application is running.
Syntax
ww_CheckClientVersion AppName, AppVersion
Arguments
AppName
The name of the application. This value is of data type nvarchar(255), with
a default of an empty string.
AppVersion
The version number of the application. This value is of data type
nvarchar(255), with a default of an empty string.
Remarks
This stored procedure is used by the IndustrialSQL Server historian to ensure
that a version of a Wonderware client application will run against the database.
A client application will not be allowed to run against a database version that
doesn't support that client.
Permission
Execute permission defaults to the public group.
See Also
ww_CheckWhichDb
ww_CheckWhichDb
Used to determine if querying the correct database.
Syntax
ww_CheckWhichDb dbType
Arguments
dbType
The identifier for the database. 1 = Runtime; 2 = Holding; 3 =
Development. This value is of data type int, with no default.
Permission
Execute permission defaults to the public group.
See Also
ww_CheckClientVersion
ww_dbCheck
Used to invalidate FactorySuite 1000 clients.
Syntax
ww_dbCheck dbType
Arguments
dbType
The identifier for the database. 1 = Runtime; 2 = Holding; 3 =
Development. This value is of data type int, with no default.
Remarks
This stored procedure is only used by client applications released prior to
FactorySuite 2000.
Permission
Execute permission defaults to the public group.
ww_DBConfig
Returns a summary of the current database configuration, such as number of
tags, number of tags per type, storage configuration, event tags, summary
configuration, and so on.
Syntax
ww_DBConfig
Permission
Execute permission defaults to the public group.
ww_LoadInSQLProcedureBody
Used internally to track which stored procedures reference the extension
tables.
Syntax
ww_LoadSQLProcedureBody ObjName
Arguments
ObjName
The name of the stored procedure to load. This value is of data type
varchar(92), with no default.
Permission
Execute permission defaults to the public group.
ww_MDASAnalogTagInsert
Used by the Manual Data Acquisition Service to add an analog tag.
This stored procedure calls the aaInternalMDASAnalogTagInsert stored
procedure, which is for internal use only.
See Also
ww_MDASAnalogTagUpdate
ww_MDASDiscreteTagInsert
ww_MDASDiscreteTagUpdate
ww_MDASStringTagInsert
ww_MDASStringTagUpdate
ww_MDASAnalogTagUpdate
Used by the Manual Data Acquisition Service to update an analog tag.
This stored procedure calls the aaInternalMDASAnalogTagUpdate stored
procedure, which is for internal use only.
See Also
Stored Procedures for Internal Use
ww_MDASAnalogTagInsert
ww_MDASDiscreteTagInsert
ww_MDASDiscreteTagUpdate
ww_MDASStringTagInsert
ww_MDASStringTagUpdate
ww_MDASDiscreteTagInsert
Used by the Manual Data Acquisition Service to add a discrete tag.
This stored procedure calls the aaInternalMDASDiscreteTagInsert stored
procedure, which is for internal use only.
See Also
Stored Procedures for Internal Use
ww_MDASAnalogTagInsert
ww_MDASAnalogTagUpdate
ww_MDASDiscreteTagUpdate
ww_MDASStringTagInsert
ww_MDASStringTagUpdate
ww_MDASDiscreteTagUpdate
Used by the Manual Data Acquisition Service to update a discrete tag.
This stored procedure calls the aaInternalMDASDiscreteTagUpdate stored
procedure, which is for internal use only.
See Also
Stored Procedures for Internal Use
ww_MDASAnalogTagInsert
ww_MDASAnalogTagUpdate
ww_MDASDiscreteTagInsert
ww_MDASStringTagInsert
ww_MDASStringTagUpdate
ww_MDASStringTagInsert
Used by the Manual Data Acquisition Service to add a string tag.
This stored procedure calls the aaInternalMDASStringTagInsert stored
procedure, which is for internal use only.
See Also
Stored Procedures for Internal Use
ww_MDASAnalogTagInsert
ww_MDASAnalogTagUpdate
ww_MDASDiscreteTagInsert
ww_MDASDiscreteTagUpdate
ww_MDASStringTagUpdate
ww_MDASStringTagUpdate
Used by the Manual Data Acquisition Service to update a string tag.
This stored procedure calls the aaInternalMDASStringTagUpdate stored
procedure, which is for internal use only.
See Also
Stored Procedures for Internal Use
ww_MDASAnalogTagInsert
ww_MDASAnalogTagUpdate
ww_MDASDiscreteTagInsert
ww_MDASDiscreteTagUpdate
ww_MDASStringTagInsert
Index
A aaHistorianStatusSelect stored procedure 121
aaHistorianStatusSet stored procedure 122
aaActionStringSelect stored procedure 89 aaHistoryBlockSelect stored procedure 123
aaAddTag stored procedure 90 aaInTouchNodeTagList stored procedure 123
aaAnalogDetail stored procedure 204 aaIODriverDelete stored procedure 124
aaAnalogTagDelete stored procedure 92 aaIODriverInsert stored procedure 124
aaAnalogTagInsert stored procedure 92 aaIODriverSelect stored procedure 126
aaAnalogTagSelect stored procedure 96 aaIODriverUpdate stored procedure 126
aaAnalogTagUpdate stored procedure 96 aaIOServerDelete stored procedure 127
aaAnnotationDelete stored procedure 97 aaIOServerInsert stored procedure 127
aaAnnotationInsert stored procedure 97 aaIOServerSelect stored procedure 129
aaAnnotationRetrieve stored procedure 98 aaIOServerTypeDelete stored procedure 129
aaAnnotationSelect stored procedure 99 aaIOServerTypeInsert stored procedure 130
aaAnnotationUpdate stored procedure 99 aaIOServerTypeSelect stored procedure 130
aaArchestrANSClear stored procedure 99 aaIOServerTypeUpdate stored procedure 131
aaAreaData table 19, 21 aaIOServerUpdate stored procedure 131
aaAreaXML table 19, 22 aaLimitDelete stored procedure 132
aaAttributeData table 19, 22 aaLimitInsert stored procedure 132
aaAttributeDataPending table 19, 23 aaLimitNameDelete stored procedure 133
aaCleanUpAfterCommit stored procedure 100 aaLimitNameInsert stored procedure 133
aaCleanupSystemNotRunning stored procedure 100 aaLimitNameSelect stored procedure 134
aaCommitChanges stored procedure 100 aaLimitNameUpdate stored procedure 134
aaCommitChangesAtStartup stored procedure 101 aaLimitSelect stored procedure 135
aaContextDelete stored procedure 101 aaLimitUpdate stored procedure 135
aaContextInsert stored procedure 102 aaMessageDelete stored procedure 135
aaContextSelect stored procedure 102 aaMessageInsert stored procedure 136
aaContextUpdate stored procedure 103 aaMessageSelect stored procedure 136
aaDBChangesPending stored procedure 103 aaMessageUpdate stored procedure 137
aaDBConfig stored procedure 103 aaModLogStatus stored procedure 137
aaDeleteOlderEvents stored procedure 104 aaObjectData column 23
aaDeleteOlderSummaries stored procedure 104 aaObjectData table 19
aaDeleteTag stored procedure 104 aaObjectDataPending table 19, 24
aaDetectorStringSelect stored procedure 105 aaPrivateNSAddGroup stored procedure 138
aaDiscreteDetail stored procedure 204 aaPrivateNSAddLeaf stored procedure 138
aaDiscreteTagDelete stored procedure 105 aaPrivateNSDeleteGroup stored procedure 139
aaDiscreteTagInsert stored procedure 105 aaPrivateNSDeleteLeaf stored procedure 139
aaDiscreteTagSelect stored procedure 108 aaPrivateNSExpand stored procedure 139
aaDiscreteTagUpdate stored procedure 108 aaPrivateNSSelect stored procedure 140
aaEngineeringUnitDelete stored procedure 109 aaPrivateNSUpdateGroup stored procedure 140
aaEngineeringUnitInsert stored procedure 109 aaPublicNSAddGroup stored procedure 141
aaEngineeringUnitSelect stored procedure 110 aaPublicNSAddLeaf stored procedure 141
aaEngineeringUnitUpdate stored procedure 111 aaPublicNSDeleteGroup stored procedure 142
aaEventDetection stored procedure 111 aaPublicNSDeleteLeaf stored procedure 142
aaEventHistoryInsert stored procedure 112 aaPublicNSExpand stored procedure 143
aaEventHistorySelect table 113 aaPublicNSSelect stored procedure 143
aaEventSnapshot stored procedure 114 aaPublicNSUpdateGroup stored procedure 143
aaEventSnapshotInsert stored procedure 113 aaRedirectToInTouch stored procedure 144
aaEventTagDelete stored procedure 114 aaSetAISamples stored procedure 145
aaEventTagDetail stored procedure 115 aaSetCalculatedAISamples stored procedure 145
aaEventTagInsert stored procedure 115 aaSetServerTimeStamp stored procedure 146
aaEventTagSelect stored procedure 118 aaSetStorageRule stored procedure 146
aaEventTagSelectAll stored procedure 118 aaSetTagStorage stored procedure 148
aaEventTagSelectDeleted stored procedure 118 aaSnapshotDetailSelect stored procedure 149
aaEventTagSelectDisabled stored procedure 119 aaSnapshotDetailUpdate stored procedure 149
aaEventTagSelectInserted stored procedure 119 aaSnapToSummary stored procedure 150
aaEventTagSelectUpdated stored procedure 119 aaSpaceManager stored procedure 150
aaEventTagUpdate stored procedure 119 aaStorageLocationSelect stored procedure 151
aaGetDbRevision stored procedure 120 aaStorageLocationUpdate stored procedure 151
aaGetLastTagKey stored procedure 120 aaStringDetail stored procedure 205
aaHistorianConfigNSExpand stored procedure 121 aaStringTagDelete stored procedure 152
aaHistorianNSExpand stored procedure 121 aaStringTagInsert stored procedure 153
P R
parameter 69 rate of change 29, 57
Parameter column 34, 193 RateDB argument 147
ParentKey argument 138, 141 RateDeadband argument 95
ParentKey column 22, 23, 24, 55, 56, 192 RateDeadband column 26, 77
Path argument 128, 152 RateOfChange table 18, 57
Path column 43, 47, 62 raw value 25, 94
PercentGood column 41 RawType argument 94
Periodicity argument 166 RawType column 26
Periodicity column 73 reconfiguration
PKey argument 121, 162, 163 See dynamic configuration
Pkey argument 140, 143 referential integrity 21
PKey column 192 RegistryName column 74
Platform argument 130 remote table 13
Platform column 49 See also extension tables
PostDetectorDelay argument 116 RequestInitialData column 76
PostDetectorDelay column 36 resolution 39, 60, 68, 78, 87, 112, 158, 176
PrefixOrSuffix column 43 Resolution argument 112, 158, 176
Priority argument 117, 133 Resolution column 68, 87
Priority column 37, 49, 57 retrieval cycles 40, 61, 80
private namespaces 18, 54 Retriever column 197
adding a group 138 Revision argument 130
adding a leaf 138 Revision column 49
deleting a group 139 rollover value 27, 95
deleting a leaf 139 RolloverValue argument 95
expanding 139 RolloverValue column 27
selecting object in 140 row count 39, 60, 78
updating a group 140 RowKey column 53, 85
PrivateGroupTag table 18, 54 RunTimeDay argument 167
PrivateNameSpace table 18, 54 RunTimeDay column 74
processing interval 75, 148, 169 RunTimeHour argument 167
ProcessingInterval argument 169 RunTimeHour column 74
ProcessingInterval column 75 RunTimeMin argument 167
ProcInterval argument 148 RunTimeMin column 74
protocols 48, 76, 128
ProtocolType argument 128 S
ProtocolType column 48, 76
Provider column 197 samples
public namespaces 18, 55, 56 active image 145
adding a group 141 Samples argument 145, 170
adding a leaf 141 SamplesInActiveImage argument 95, 107, 154
deleting a group 142 SamplesInActiveImage column 71
deleting a leaf 142 scaling 26, 94
expanding 143 Scaling argument 94
selecting object in 143 Scaling column 26
updating group 143 scan rate
PublicGroupTag table 18, 55 for event tags 35, 116
PublicNameSpace table 18, 56 ScanRate argument 116
ScanRate column 35
Q Script column 59
script template 59
quality 25, 32, 38, 50, 54, 65, 66, 84, 85, 87, 191, security
196, 199, 200 levels 77
percentage 41 Sequence column 42
Quality column 25, 32, 38, 50, 65, 66, 84, 85, 87, server list 57
191, 194, 195, 196, 197, 198, 199, 200, 201, 202 ServerKey argument 138, 142