How do I import and Display this Existing XML File?

Slabs1960

Member
Joined
Mar 19, 2017
Messages
19
Programming Experience
10+
I have an existing XML file that I would like to add to a data set and display on a form, in data grid view. It is not in the normal format of Table and Table Columns. I have no idea on how to do this.

Please assist.

VB.NET:
<?xml version="1.0" encoding="utf-8"?>
<template desc="Digital01 - Siemens">
  <param name="type">
    <string name="name">DIG01s</string>
    <string name="ref">DIG01s</string>
    <string name="blank"></string>
    <string name="wildcard"></string>
    <string name="parameter-definitions">plc.addr_db=;alarm.area=;alarm.page=</string>
  </param>
  <input name="equipment" file="equip.dbf" desc="Equipment Database">
    <field name="NAME" />
    <field name="CLUSTER" />
    <field name="TYPE" />
    <field name="AREA" />
    <field name="LOCATION" />
    <field name="COMMENT" />
    <field name="CUSTOM1" />
    <field name="CUSTOM2" />
    <field name="CUSTOM3" />
    <field name="CUSTOM4" />
    <field name="CUSTOM5" />
    <field name="CUSTOM6" />
    <field name="CUSTOM7" />
    <field name="CUSTOM8" />
    <field name="IODEVICE" />
    <field name="PAGE" />
    <field name="HELP" />
    <field name="DEFSTATE" />
    <field name="SCHEDULED" />
    <field name="COMPOSITE" />
    <field name="TAGPREFIX" />
    <field name="PARAM" />
    <field name="DEVSCHED" />
    <field name="SCHEDID" />
    <array name="param_list">{ToProperty('{param}','=',';')}</array>
    <array name="plc">{ToProperty('{equipment.param_list[plc]}',':',',')}</array>
    <array name="alarm">{ToProperty('{equipment.param_list[alarm]}',':',',')}</array>
  </input>
  <output name="Element" file="variable.dbf" filter="'{equipment.type}={type.name}'">
    <field name="NAME" key="true">{equipment.tagprefix}_Command</field>
    <field name="TYPE">UINT</field>
    <field name="UNIT">{equipment.iodevice}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Command Word</field>
    <field name="CLUSTER" key="true">{equipment.cluster}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="ADDR">DB{equipment.plc[addr_db]},32</field>
    <field name="ITEM">Command_Word</field>
    <field name="TAGGENLINK" load="true">e26507a9-7ed9-4ec2-8bef-77d4</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">3939343</field>
  </output>
  <output name="Element_1" file="variable.dbf" filter="'{equipment.type}={type.name}'">
    <field name="NAME" key="true">{equipment.tagprefix}_Alarm</field>
    <field name="TYPE">UINT</field>
    <field name="UNIT">{equipment.iodevice}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Alarm Word</field>
    <field name="CLUSTER" key="true">{equipment.cluster}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="ADDR">DB{equipment.plc[addr_db]},22</field>
    <field name="ITEM">Alarm_Word</field>
    <field name="TAGGENLINK" load="true">e48db364-f777-4ff6-b81b-ddac</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">3939343</field>
  </output>
  <output name="Element_3" file="trend.dbf" filter="'{equipment.type}={type.name}'">
    <field name="NAME" key="true">{equipment.tagprefix}_Alarm</field>
    <field name="EXPR">{equipment.tagprefix}_Alarm</field>
    <field name="SAMPLEPER">00:00:02</field>
    <field name="FILES">54</field>
    <field name="TIME">00:00:00</field>
    <field name="PERIOD">Monday</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Alarm Word</field>
    <field name="TYPE">TRN_PERIODIC</field>
    <field name="STORMETHOD">Floating Point (8-byte samples)</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_PNone</field>
    <field name="FILENAME">[DATA]:\Trendlog\{equipment.alarm[area]}\{equipment.tagprefix}\{equipment.tagprefix}_Alarm</field>
    <field name="ITEM">Alarm_Word</field>
    <field name="TAGGENLINK" load="true">9852cbfe-2511-47ad-90cc-5525</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">467681051</field>
  </output>
  <output name="Element_1_1" file="variable.dbf" filter="'{equipment.type}={type.name}'">
    <field name="NAME" key="true">{equipment.tagprefix}_Status</field>
    <field name="TYPE">LONG</field>
    <field name="UNIT">{equipment.iodevice}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Status Word</field>
    <field name="CLUSTER" key="true">{equipment.cluster}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="ADDR">DB{equipment.plc[addr_db]},24</field>
    <field name="ITEM">Status_Word</field>
    <field name="TAGGENLINK" load="true">ee6091b7-52c0-4840-9c53-2dc8</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">3939343</field>
  </output>
  <output name="Element_4" file="trend.dbf" filter="'{equipment.type}={type.name}'">
    <field name="NAME" key="true">{equipment.tagprefix}_Status</field>
    <field name="EXPR">{equipment.tagprefix}_Status</field>
    <field name="SAMPLEPER">00:00:02</field>
    <field name="FILES">54</field>
    <field name="TIME">00:00:00</field>
    <field name="PERIOD">Monday</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Status Word</field>
    <field name="TYPE">TRN_PERIODIC</field>
    <field name="STORMETHOD">Floating Point (8-byte samples)</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_PNone</field>
    <field name="FILENAME">[DATA]:\Trendlog\{equipment.alarm[area]}\{equipment.tagprefix}\{equipment.tagprefix}_Status</field>
    <field name="ITEM">Status_Word</field>
    <field name="TAGGENLINK" load="true">beddecd9-59ed-47af-8da5-0b53</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">467681051</field>
  </output>
  <output name="Element_2" file="variable.dbf" filter="'{equipment.type}={type.name}'">
    <field name="NAME" key="true">{equipment.tagprefix}_Delay_Time</field>
    <field name="TYPE">LONG</field>
    <field name="UNIT">{equipment.iodevice}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Delay Time</field>
    <field name="CLUSTER" key="true">{equipment.cluster}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="ADDR">DB{equipment.plc[addr_db]},28</field>
    <field name="FORMAT">###</field>
    <field name="ENG_UNITS">s</field>
    <field name="ITEM">Delay_Time</field>
    <field name="TAGGENLINK" load="true">6a2609ef-2712-4076-9db8-b2da</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">3940111</field>
  </output>
  <output name="Element_8_1_2" file="advalm.dbf" filter="'{equipment.type}={type.name}'">
    <field name="TAG" key="true">{equipment.tagprefix}_Bus_FU</field>
    <field name="NAME">{equipment.tagprefix}</field>
    <field name="DESC">Bus First Up</field>
    <field name="EXPR">xTagbit({equipment.tagprefix}_Alarm, _iBus_FU)</field>
    <field name="CATEGORY">_CW{equipment.alarm[area]}</field>
    <field name="HELP">{equipment.tagprefix} {equipment.alarm[page]}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Bus FU</field>
    <field name="DELAY">00:00:00</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_POper</field>
    <field name="AREA">_AA{equipment.alarm[area]}</field>
    <field name="ITEM">Alm_Bus_FU</field>
    <field name="TAGGENLINK" load="true">8ce99297-376a-4dac-ad54-03e5</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">130549247</field>
  </output>
  <output name="Element_8_1_3" file="advalm.dbf" filter="'{equipment.type}={type.name}'">
    <field name="TAG" key="true">{equipment.tagprefix}_Bypass</field>
    <field name="NAME">{equipment.tagprefix}</field>
    <field name="DESC">Bypass</field>
    <field name="EXPR">XTagbit({equipment.tagprefix}_Status, _iBypass)</field>
    <field name="CATEGORY">_CW{equipment.alarm[area]}</field>
    <field name="HELP">{equipment.tagprefix} {equipment.alarm[page]}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Bypass</field>
    <field name="DELAY">00:00:00</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_POper</field>
    <field name="AREA">_AA{equipment.alarm[area]}</field>
    <field name="ITEM">Alm_Bypass</field>
    <field name="TAGGENLINK" load="true">22a0fa2c-77c9-40b6-a42a-b26a</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">130549247</field>
  </output>
  <output name="Element_8_1_4" file="advalm.dbf" filter="'{equipment.type}={type.name}'">
    <field name="TAG" key="true">{equipment.tagprefix}_Simulate</field>
    <field name="NAME">{equipment.tagprefix}</field>
    <field name="DESC">Simulate</field>
    <field name="EXPR">XTagbit({equipment.tagprefix}_Status, _iSimulate)</field>
    <field name="CATEGORY">_CU{equipment.alarm[area]}</field>
    <field name="HELP">{equipment.tagprefix} {equipment.alarm[page]}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Simulate</field>
    <field name="DELAY">00:00:00</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_POper</field>
    <field name="AREA">_AA{equipment.alarm[area]}</field>
    <field name="ITEM">Alm_Simulate</field>
    <field name="TAGGENLINK" load="true">92e257bc-2d69-444c-b8bc-e575</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">130549247</field>
  </output>
  <output name="Element_8_1_5" file="advalm.dbf" filter="'{equipment.type}={type.name}'">
    <field name="TAG" key="true">{equipment.tagprefix}_Bus_Fault</field>
    <field name="NAME">{equipment.tagprefix}</field>
    <field name="DESC">Bus Fault</field>
    <field name="EXPR">XTagbit({equipment.tagprefix}_Status, _iBus_Healthy)</field>
    <field name="CATEGORY">_CE{equipment.alarm[area]}</field>
    <field name="HELP">{equipment.tagprefix} {equipment.alarm[page]}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Bus Fault</field>
    <field name="DELAY">00:00:00</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_POper</field>
    <field name="AREA">_AA{equipment.alarm[area]}</field>
    <field name="ITEM">Alm_Bus_Fault</field>
    <field name="TAGGENLINK" load="true">be636401-212b-43e9-a27b-0911</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">130549247</field>
  </output>
  <output name="Element_8_1_6" file="advalm.dbf" filter="'{equipment.type}={type.name}'">
    <field name="TAG" key="true">{equipment.tagprefix}_First_Up_Alarm</field>
    <field name="NAME">{equipment.tagprefix}</field>
    <field name="DESC">Fisrt Up Alarm</field>
    <field name="EXPR">XTagbit({equipment.tagprefix}_Status, _iFirst_Up_Alarm)</field>
    <field name="CATEGORY">_CE{equipment.alarm[area]}</field>
    <field name="HELP">{equipment.tagprefix} {equipment.alarm[page]}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} First Up Alarm</field>
    <field name="DELAY">00:00:00</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_POper</field>
    <field name="AREA">_AA{equipment.alarm[area]}</field>
    <field name="ITEM">Alm_First_Up_Alarm</field>
    <field name="TAGGENLINK" load="true">84d56104-029e-4399-9e6e-e3a4</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">130549247</field>
  </output>
  <output name="Element_8_1_7" file="advalm.dbf" filter="'{equipment.type}={type.name}'">
    <field name="TAG" key="true">{equipment.tagprefix}_Input_FU</field>
    <field name="NAME">{equipment.tagprefix}</field>
    <field name="DESC">Input first Up</field>
    <field name="EXPR">XTagbit({equipment.tagprefix}_Status, _iInput_FU)</field>
    <field name="CATEGORY">_CU{equipment.alarm[area]}</field>
    <field name="HELP">{equipment.tagprefix} {equipment.alarm[page]}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Input FU</field>
    <field name="DELAY">00:00:00</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_POper</field>
    <field name="AREA">_AA{equipment.alarm[area]}</field>
    <field name="ITEM">Alm_Input_First_up</field>
    <field name="TAGGENLINK" load="true">749a707c-080b-40f1-a976-f8f9</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">130549247</field>
  </output>
  <output name="Element_8_1_8" file="advalm.dbf" filter="'{equipment.type}={type.name}'">
    <field name="TAG" key="true">{equipment.tagprefix}_Safety_Input</field>
    <field name="NAME">{equipment.tagprefix}</field>
    <field name="DESC">Input_FU</field>
    <field name="EXPR">XTagbit({equipment.tagprefix}_Status, _iSafety_Input)</field>
    <field name="CATEGORY">_CE{equipment.alarm[area]}</field>
    <field name="HELP">{equipment.tagprefix} {equipment.alarm[page]}</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Safety Input</field>
    <field name="DELAY">00:00:00</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_POper</field>
    <field name="AREA">_AA{equipment.alarm[area]}</field>
    <field name="ITEM">Alm_Safety_Input</field>
    <field name="TAGGENLINK" load="true">60a6408d-d05b-4fab-81ee-c0bc</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">130549247</field>
  </output>
  <output name="Element_8_1_12" file="advalm.dbf" filter="'{equipment.type}={type.name}'">
    <field name="TAG" key="true">{equipment.tagprefix}_Command</field>
    <field name="NAME">{equipment.tagprefix}</field>
    <field name="DESC">Command</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Command</field>
    <field name="DELAY">00:00:00</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_POper</field>
    <field name="AREA">_AA{equipment.alarm[area]}</field>
    <field name="EXPR">0</field>
    <field name="ITEM">Alm_Command</field>
    <field name="TAGGENLINK" load="true">031f2420-f7eb-43f8-877c-602c</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">130549199</field>
  </output>
  <output name="Element_6" file="trend.dbf" filter="'{equipment.type}={type.name}'">
    <field name="NAME" key="true">{equipment.tagprefix}_Input</field>
    <field name="EXPR">XTagbit({equipment.tagprefix}_Status, _iManipulated_Input)</field>
    <field name="SAMPLEPER">00:00:02</field>
    <field name="FILES">54</field>
    <field name="TIME">06:00:00</field>
    <field name="PERIOD">Monday</field>
    <field name="COMMENT">{equipment.tagprefix} - {equipment.comment} Manipulated Input</field>
    <field name="TYPE">TRN_PERIODIC</field>
    <field name="STORMETHOD">Floating Point (8-byte samples)</field>
    <field name="CLUSTER" key="true">{equipment.CLUSTER}</field>
    <field name="EQUIP">{equipment.name}</field>
    <field name="PRIV">_POper</field>
    <field name="FILENAME">[DATA]:\Trendlog\{equipment.alarm[area]}\{equipment.tagprefix}\{equipment.tagprefix}_Input</field>
    <field name="ITEM">Trn_Input</field>
    <field name="TAGGENLINK" load="true">af3aea09-e008-4096-ac4b-274c</field>
    <field name="LINKED">1</field>
    <field name="EDITCODE">467681051</field>
  </output>
  <genie name="Namdeb-Kernel.namdeb_digital.gDig01s">
    <property name="Tag"></property>
    <property name="Device_Type">DIG01</property>
    <property name="Hide">FALSE</property>
    <property name="Text">ZS</property>
    <property name="Equipment"></property>
  </genie>
</template>
 
Top Bottom