jweaver
New member
- Joined
- Mar 26, 2008
- Messages
- 2
- Programming Experience
- 1-3
Below is an example of the XML file I need to read.
In my program I need to get the IGroup and IOffset information for each "Symbol". How can I write a program that would automatically make a class reading data from the XML file? I could then add this class to my project and use it like this:
Main.SlideTimeout.IGroup
Main.SlideTimeout.Ioffset
Right now I use XPath to search for Symbol by name and load the IGroup and Ioffset info into a structure. This is time consuming when there are alot of Symbols and I have to manually type in each Symbol name. I could load all the symbols into an arraylist of structures but then it is hard to keep them straight by index. Any help would be greatly appreciated.
In my program I need to get the IGroup and IOffset information for each "Symbol". How can I write a program that would automatically make a class reading data from the XML file? I could then add this class to my project and use it like this:
Main.SlideTimeout.IGroup
Main.SlideTimeout.Ioffset
Right now I use XPath to search for Symbol by name and load the IGroup and Ioffset info into a structure. This is time consuming when there are alot of Symbols and I have to manually type in each Symbol name. I could load all the symbols into an arraylist of structures but then it is hard to keep them straight by index. Any help would be greatly appreciated.
VB.NET:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--This file is created by the TCatPlcCtrl automatically. Manually changes will be overwritten!-->
<PlcProjectInfo xmlns:p="http://www.beckhoff.com/2002/01/TcPlcProjectDesc">
<Symbols>
<Symbol>
<Name TaskPrio="1">MAIN.SlideTimout</Name>
<Type>TIME</Type>
<IGroup>16448</IGroup>
<IOffset>24</IOffset>
<BitSize>32</BitSize>
</Symbol>
<Symbol>
<Name TaskPrio="1">MAIN.WriteCycle</Name>
<Type>BOOL</Type>
<Comment>
<![CDATA[Write PB pressed]]>
</Comment>
<IGroup>16448</IGroup>
<IOffset>28</IOffset>
<BitSize>8</BitSize>
</Symbol>
</Symbols>
</PlcProjectInfo>