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 to export, or 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
|
|
If custom, will be defined by a "permissions" tag.
|
OPCServer
|
String
|
|
|
OPCItemPath
|
String
|
|
|
OPCWriteBackServer
|
String
|
|
|
OPCWriteBackItemPath
|
String
|
|
|
ScaleMode
|
Int
|
|
|
ScaleFactor
|
Float
|
|
|
RawLow
|
Float
|
|
|
RawHigh
|
Float
|
|
|
ScaledLow
|
Float
|
|
|
ScaledHigh
|
Float
|
|
|
ClampMode
|
Int
|
|
|
Deadband
|
Float
|
|
|
DeadbandMode
|
Int
|
|
|
FormatString
|
String
|
|
|
EngUnit
|
String
|
|
|
EngLow
|
Float
|
|
|
EngHigh
|
Float
|
|
|
EngLimitMode
|
Int
|
|
|
Tooltip
|
String
|
|
|
Documentation
|
String
|
|
|
ExpressionType
|
Int
|
|
|
DriverName
|
String
|
|
|
ScanClass
|
String
|
|
|
HistoryEnabled
|
Boolean
|
|
|
PrimaryHistoryProvider
|
String
|
|
|
HistoricalDeadband
|
Float
|
|
|
HistoricalDeadbandMode
|
Int
|
|
|
HistoricalScanclass
|
String
|
|
|
InterpolationMode
|
Int
|
|
|
HistoryTimestampSource
|
Int
|
|
|
HistoryMaxAgeMode
|
Int
|
|
|
HistoryMaxAge
|
Int
|
|
|
UDTParentType
|
String
|
|
|
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.
|
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. |
|