Top  | Previous | Next

Importing/Exporting Tags

 

It is possible to export and import tags to/from an XML file format using the toolbar on the Tag Browser window. Simply click the Export button sqlt_csv_export to export, or Import sqlt_csv_import to load a previously exported file. Duplicate folders will be merged together, with new tags overwriting existing tags where there are duplications.

 

XML Structure

The basic structure of the xml file is as follows:

<Tags>

   <Tag name="..." path="..." type="...">

      <Property name="...">...</Property>

      ...

      <Parameters>

         <Property name="..." type="...">...</Property>

      </Parameters>

      <Alarms>

         <Alarm name="...">

            <Property name="...">...</Property>

            <Property name="..." bindtype="...">...</Property>

         </Alarm>

      </Alarms>

      <Permissions>

               <Entry name="Administrator" hasWriteAccess="false"/>

      </Permissions>

   </Tag>

</Tags>

Tag Definition

Tags have three main attributes:

name - The name of the tag.

path - The folder path of the tag

type - The type of the tag (as in its function, not data type), which is one of the following values:

OPC

DB - Note: this is named this way for historical reasons. A "DB" tag is used to define Memory, Query, and Expression tags. The difference between these tags is defined by the presence and value of the "Expression" and "ExpressionType" properties (both being absent for memory tags).

Client

Folder

UDT_DEF - Type definition

UDT_INST - UDT Instance definition

EXTENSION - An override of a member defined in a parent type

Property Values

Tags (as well as sub elements, such as parameters and alarms) are defined by a collection of "Property" tags. The property generally consists of a name and value, though in some cases there might be additional attributes available.

 

Tag Properties

Property Name

Type

Values (if applicable)

Description

Value



The value of the tag, dependant on the data type.

DataType

Int

0 - Int1

1 - Int2

2 - Int4

3 - Int8

4 - Float4

5 - Float8

6 - Boolean

7 - String

8 - DateTime

9 - DataSet


Enabled

Booelan

true/false


AccessRights

Int

0 - Read Only

1 - Read/Write

2 - Custom

If custom, will be defined by a "permissions" tag.

OPCServer

String



OPCItemPath

String



OPCWriteBackServer

String


"Write back" target for expression tags.

OPCWriteBackItemPath

String



ScaleMode

Int

0 - Off

1 - Linear

2 - Square Root

3 - Exponential Filter


ScaleFactor

Float

 

For exponential filter

RawLow

Float

 

Defines scale range

RawHigh

Float

 


ScaledLow

Float

 


ScaledHigh

Float

 


ClampMode

Int

0 - None

1 - Low

2 - High

3 - Both


Deadband

Float

 


DeadbandMode

Int

0 - Absolute

1 - Percentage


FormatString

String

 


EngUnit

String

 


EngLow

Float

 


EngHigh

Float

 


EngLimitMode

Int

0 - None

1 - Low

2 - High

3 - Both


Tooltip

String

 


Documentation

String

 


ExpressionType

Int

0 - None

1 - Expression

2 - SQL Query


DriverName

String

 

Used for external tags

ScanClass

String

 


HistoryEnabled

Boolean

true/false


PrimaryHistoryProvider

String

 

The history provider to use if storing history

HistoricalDeadband

Float

 


HistoricalDeadbandMode

Int

0 - Absolute

1 - Percentage


HistoricalScanclass

String

 


InterpolationMode

Int

0 - Discrete

2 - Analog (deadband)

3 - Analog (compressed)

How values are interpolated. 2 exists for backwards compatibility (and is equivalent to 1), but only 0 or 3 should be used in the future.

HistoryTimestampSource

Int

0 - System

1 - Value


HistoryMaxAgeMode

Int

0 - Unlimited

1 - Limited


HistoryMaxAge

Int

 

Max cycles between storage.

UDTParentType

String

 

The path to the parent UDT type. Used by sub-types and instances.

 

Alarm Properties

Property Name

Type

Values (if applicable)

Description

Enabled

Boolean

true/false


Priority

String

Diagnostic, Low, Medium, High, Critical

May also be numeric, 0-4.

DisplayPath

String



ActivePipeline

String



ClearPipeline




Deadband

Float



DeadbandEvalMode

Integer

0 - Absolute

1 - Percentage


TimeOnDelaySeconds

Float


The "active delay"

TimeOffDelaySeconds

Float


The "clear delay"

TimestampSource

Int

0 - System

1 - Value


AckMode

Int

0 - Unused

1 - Auto

2 - Manual


Notes

String



AckNotesReqd

Boolean

true/false


ShelvingAllowed

Boolean

true/false


Mode

String

Equality

Inequality

AboveValue

BelowValue

BetweenValues

OutsideValues

OutOfEngRange

BadQuality

AnyChange

Bit

OnCondition


SetpointA



The setpoint, or the "low" setpoint for dual value modes.

SetpointB



The "high" setpoint for dual setpoint modes.

InclusiveA

Boolean



InclusiveB

Boolean



BitOnZero

Boolean


Used by the "Bit" condition, to indicate that 0 is "active"

BitPosition

Integer


Bit to use in "Bit" condition.

ActiveCondition

Boolean


The property that drives the "OnCondition" mode

AnyChange

Boolean


Whether or not to apply the "any change" behavior in applicable modes.

 

Binding Alarm Properties

The alarm properties can be bound to tags or expressions. To do this, set the "bindtype" attribute on the property to "Tag" or "Expression". The value will then either be a tag path (absolute or relative), or an expression.

 

User Defined Data Types (Complex Tags)

Complex tags are more or less defined like normal tags, but with a few important differences:

The tag type will be UDT_TYPE, UDT_INST, or EXTENSION.
The tag may contain nested tags, which will be the members.
Unless it is a top level type definition, the tag will have a "UDTParentType" property defined.
The tag may have a "Parameters" element, which will define the parameters. Each parameter will be a property, but the property may have a "type" attribute to define the type of the parameter. Valid types are "String", "Integer", and "Float".
Parameters are overridden by re-definition in sub-types. In other words, a <Parameters> element in a sub type with the same parameters names will override the parent parameters.
Member tag values are overridden by defining and "extension" tag in sub types.