XML File Format
Format
The format for a XML file is as follows:
Note: Any tag property can be modified this way. See CSV File Formats for a list of properties.
For a list of tags:
<Import>
<TagList>
<Tag>
<Tagname> .....</Tagname>
<Description> Test </Description>
</Tag>
</TagList>
</Import>
For Data:
<Import>
<Datalist>
<Tag>
<Data>
<Timestamp>..... </Timestamp>
<Value>.... </Value>
</Data>
</Tag>
</Datalist>
</Import>
For Messages :
<Import>
<MessageList>
<Data>
<Timestamp>..... </Timestamp>
<Topic>.... </Topic>
<Username>.... </Username>
<MessageNumber>.... </MessageNumber>
<MessageString>.... </MessageString>
<Substitutions>.... </Substitutions>
</Data>
</MessageList>
</Import>
Example of an XML File that Imports Tags
<Import>
<TagList Version="1.0.71">
<Tag Name="TIGER.IMPORT_TAG1.F_CV">
<Tagname>TIGER.IMPORT_TAG1.F_CV</Tagname>
<Description>Import Tag 1</Description>
<EngineeringUnits> PSI </EngineeringUnits>
</Tag>
<Tag Name="TIGER.IMPORT_TAG11.F_CV">
<Tagname>TIGER.IMPORT_TAG11.F_CV</Tagname>
<Description>Import Tag 1</Description>
<EngineeringUnits> PSI </EngineeringUnits>
</Tag>
<Tag Name="TIGER.IMPORT_TAG12.F_CV">
<Tagname>TIGER.IMPORT_TAG12.F_CV</Tagname>
<Description>Import Tag 2</Description>
<EngineeringUnits> PSI </EngineeringUnits>
</Tag>
<Tag Name="TIGER.IMPORT_TAG13.F_CV">
<Tagname>TIGER.IMPORT_TAG13.F_CV</Tagname>
<Description>Import Tag 3</Description>
<EngineeringUnits> PSI </EngineeringUnits>
</Tag>
<Tag Name="TIGER.IMPORT_TAG14.F_CV">
<Tagname>TIGER.IMPORT_TAG14.F_CV</Tagname>
<Description>Import Tag 4</Description>
<EngineeringUnits> PSI </EngineeringUnits>
</Tag>
<Tag Name="TIGER.IMPORT_TAG15.F_CV">
<Tagname>TIGER.IMPORT_TAG15.F_CV</Tagname>
<Description>Import Tag 5</Description>
<EngineeringUnits> PSI </EngineeringUnits>
</Tag>
<Tag Name="TIGER.IMPORT_TAG2.F_CV">
<Tagname>TIGER.IMPORT_TAG2.F_CV</Tagname>
<Description>Import Tag 2</Description>
<EngineeringUnits> PSI </EngineeringUnits>
</Tag>
<Tag Name="TIGER.IMPORT_TAG21.F_CV">
<Tagname>TIGER.IMPORT_TAG21.F_CV</Tagname>
<Description>Import Tag 1</Description>
<EngineeringUnits> PSI </EngineeringUnits>
</Tag>
</TagList>
</Import>
Example of an XML file that Imports Data and Data Quality
<Import>
<DataList Version="1.0.71">
<Tag Name="TIGER.IMPORT_TAG1.F_CV">
<Data>
<TimeStamp>20-Jul-2001 11:00:18.000</TimeStamp>
<Value>0</Value>
<DataQuality>Good</DataQuality>
</Data>
<Data>
<TimeStamp>20-Jul-2001 11:00:36.000</TimeStamp>
<Value>0</Value>
<DataQuality>Good</DataQuality>
</Data>
<Data>
<TimeStamp>20-Jul-2001 11:00:54.000</TimeStamp>
<Value>0</Value>
<DataQuality>Bad</DataQuality>
</Data>
<Data>
<TimeStamp>20-Jul-2001 11:01:12.000</TimeStamp>
<Value>0</Value>
<DataQuality>Good</DataQuality>
</Data>
</Tag>
</DataList>
</Import>
Example of an XML file that Imports Messages
<Import>
<MessageList Version="1.0.71">
<Data>
<TimeStamp>28-Aug-2002 19:42:00.000</TimeStamp>
<Topic>General</Topic>
<Username>XMLUser</Username>
<MessageNumber>0</MessageNumber>
<MessageString>Another test message</MessageString>
<Substitutions></Substitutions>
</Data>
<Data>
<TimeStamp>28-Aug-2002 19:48:00.000</TimeStamp>
<Topic>General</Topic>
<Username>XMLUser</Username>
<MessageNumber>1</MessageNumber>
<MessageString>Message One</MessageString>
<Substitutions></Substitutions>
</Data>
</MessageList>
</Import>
Example of an XML file that Imports a Tag with a Step Value
<Import>
<TagList Version="1.0.71">
<Tag Name="TAG6">
<Tagname>TAG6</Tagname>
<StepValue> TRUE </StepValue>
</Tag>
</TagList>
</Import>
Example of an XML file that Imports Alarms
<Import>
<AlarmList Version="1.0.71">
<Alarm>
<Attribute name="Acked" value="false"/>
<Attribute name="Actor" value="TheActor"/>
<Attribute name="Condition" value="Condition"/>
<Attribute name="DataSource" value="File collector"/>
<Attribute name="Enabled" value="true"/>
<Attribute name="EndTime" value="12/25/2005 12:47:59.003"/>
<Attribute name="EventCategory" value="Process"/>
<Attribute name="Message" value="My message."/>
<Attribute name="Quality" value="Good"/>
<Attribute name="Severity" value="250"/>
<Attribute name="Source" value="SourceXML000003"/>
<Attribute name="StartTime" value="12/25/2005 12:47:59.003"/>
<Attribute name="SubCondition" value="Hi"/>
<Attribute name="TagName" value="TheTagName"/>
<Attribute name="Timestamp" value="12/09/2005 12:47:59.003"/>
</Alarm>
<Alarm>
<Attribute name="Acked" value="false"/>
<Attribute name="Actor" value="TheActor"/>
<Attribute name="Condition" value="Condition"/>
<Attribute name="DataSource" value="File collector"/>
<Attribute name="Enabled" value="true"/>
<Attribute name="EndTime" value="12/25/2005 12:47:59.004"/>
<Attribute name="EventCategory" value="Process"/>
<Attribute name="Message" value="My message."/>
<Attribute name="Quality" value="Good"/>
<Attribute name="Severity" value="250"/>
<Attribute name="Source" value="SourceXML000004"/>
<Attribute name="StartTime" value="12/25/2005 12:47:59.004"/>
<Attribute name="SubCondition" value="Hi"/>
<Attribute name="TagName" value="TheTagName"/>
<Attribute name="Timestamp" value="12/25/2005 12:47:59.004"/>
</Alarm>
</AlarmList>
</Import>
Example of an XML file that Imports Enumerated Set
<Import>
<EnumeratedSetList>
<EnumeratedSet SetName="TestSet7">
<EnumeratedState StateName="State1">
<SetName>TestSet7</SetName>
<SetDescription>TestDesc</SetDescription>
<StateLowRawValue>1</StateLowRawValue>
<StateHighRawValue>10</StateHighRawValue>
<StateDescription>State1Desc</StateDescription>
<StateName>State1</StateName>
<StateRawValueDataType>DoubleFloat</StateRawValueDataType>
<LastModified>9/17/2012 16:37:48.260000</LastModified>
<LastModifiedUser>GECORPORATE\312006949</LastModifiedUser>
<AdministratorSecurityGroup></AdministratorSecurityGroup>
<NumberOfStatesInThisSet>2</NumberOfStatesInThisSet>
</EnumeratedState>
<EnumeratedState StateName="State2">
<SetName>TestSet7</SetName>
<SetDescription>TestDesc</SetDescription>
<StateLowRawValue>11</StateLowRawValue>
<StateHighRawValue>20</StateHighRawValue>
<StateDescription>State2Desc</StateDescription>
<StateName>State2</StateName>
<StateRawValueDataType>DoubleFloat</StateRawValueDataType>
<LastModified>9/17/2012 16:37:48.260000</LastModified>
<LastModifiedUser>GECORPORATE\312006949</LastModifiedUser>
<AdministratorSecurityGroup></AdministratorSecurityGroup>
<NumberOfStatesInThisSet>2</NumberOfStatesInThisSet>
</EnumeratedState>
</EnumeratedSet>
</EnumeratedSetList>
</Import>
Example of an XML File that Imports Array Tags
<Import>
<TagList Version="1.0.71">
<Tag Name="ArrayTag1">
<Tagname>ArrayTag</Tagname>
<Description>Import array Tag 1</Description>
<EngineeringUnits> PSI </EngineeringUnits>
<NumberOfElements>-1</NumberOfElements>
</Tag>
<Tag Name="ArrayTag2">
<Tagname>ArrayTag2</Tagname>
<Description>Import array Tag 2</Description>
<EngineeringUnits> PSI </EngineeringUnits>
<NumberOfElements>-1</NumberOfElements>
</Tag>
</TagList>
</Import>
Example of an XML File that Imports Array Tag data
<Import>
<DataList Version="1.0.71">
<Tag Name="ArrayTag[0]">
<Data>
<TimeStamp>11-June-2013 11:00:18.000</TimeStamp>
<Value>1</Value>
<DataQuality>Good</DataQuality>
</Data>
<Data>
<TimeStamp>11-June-2013 11:01:18.000</TimeStamp>
<Value>2</Value>
<DataQuality>Good</DataQuality>
</Data>
</Tag>
<Tag Name="ArrayTag[1]">
<Data>
<TimeStamp>11-June-2013 11:00:18.000</TimeStamp>
<Value>3</Value>
<DataQuality>Good</DataQuality>
</Data>
<Data>
<TimeStamp>11-June-2013 11:01:18.000</TimeStamp>
<Value>4</Value>
<DataQuality>Good</DataQuality>
</Data>
</Tag>
</DataList>
</Import>
Example of an XML File that Imports Python Expression Tags
<Import>
<TagList Version="1.0.71">
<Tag Name="TagDerivedFromRawValue">
<Tagname>TagDerivedFromRawValue</Tagname>
<CollectorName>OpcServerCollector</CollectorName>
<SourceAddress>
"{"imports":["math"],"script":"tag.value + math.pow(10,tag.value/70)","parameters":
[{"name":"tag","source":{"address":"IO/READONLY/Temperature","dataType":"DoubleFloat"}}]}"
</SourceAddress>
<CalcType>PythonExpr</CalcType>
<DataType>DoubleFloat</DataType>
<Description>Python Expression Tag example</Description>
</Tag>
</TagList>
</Import>
Note:
- Python Expression Tags do not support array or multifield tags.
- It is important to include the CalcType header and set it to PythonExpr for each Python Expression tag. If the file contains a mix of tags that are Python Expression Tags with those that are not, then the tags that are not should have the CalcType field set to Raw.
- For Python Expression Tags, the SourceAddress must contain the tag's minified JSON configuration con- structed as described in the topic on Constructing the JSON Configuration for a Python Expression Tag. (Minified JSON has no newline characters or comments. There are tools which can help you minify JSON.)
- It is important to check that your JSON is valid, since no validation will be performed on the JSON at tag creation.
For more information about these tags, refer to the Python Expression Tags.