Chicago LabVIEW User Group

cancel
Showing results for 
Search instead for 
Did you mean: 

Get data / parse from xml file.

Hi I am new to the LabView... I need help parsing following xml file.

Any one provide me code or walk me through. I will greately appreicate it.

Currently the way i do it providing xml file path via vi and i wants to parse or extract

result of any particular data. my following XML file we can refere to as myXML.xml

Please see attached files. I wants to get value of all_auto_service_enabled...

or I wants to get value of ServiceSettings.

How can i parse it?

Download All
0 Kudos
Message 1 of 6
(11,815 Views)

Is this xml file generated elsewhere and you are just going to be reading it?

there are a couple differnt ways to approach this, you can use the XML Parser VIs within Labview (look in the File IO Palette>XML>XML Parser) I can work on a couple examples, but what version of LabVIEW are you using?

Another way is to install the VI Package Manager from JKI. they then have a EasyXML package you can tryout, not sure if there is a limit for it, but you can also purchase it. I have found that I use EasyXML for many things although in some cases I still use the XML Parser tools within LabVIEW.

Jeff D.

Certified Architect LabVIEW Champion DQMH Framework

0 Kudos
Message 2 of 6
(6,463 Views)

Hi
Yes the xml file generated elsewhere. I get get that file from there and i need to parse it.

I am using LabView 2010. I tried xml parser from labview but it did not work for me. I am very new to labview. If you can help me or provide me vi which parse my attached file. I will greately

appreciate.

0 Kudos
Message 3 of 6
(6,463 Views)

Here's a link for EasyXML as jdebuhr suggested, it might be the easiest way to read your file's format (which is harder to do with the built in LabVIEW stuff): http://sine.ni.com/nips/cds/view/p/lang/en/nid/209021

Do you have any programming experience in other languages?  If you just want to parse this file with its specific format, you can build a parser in LabVIEW in ways similar to how you can in many other languages (you could do it as simply as string parsing, for example, though this isn't recommended).  But you have to think through what you need and want to do and we can give some advice if you need.  If you want to parse XML files of varying format, or just do it quickly, try out EasyXML.

That all said, welcome to LabVIEW.  If you give it enough time to learn, its a brilliant language that can do a lot for you.

0 Kudos
Message 4 of 6
(6,463 Views)

Sorry I did not have any time this weekend to look it over.

Have you given it a try yet using what Joseph suggested?

Jeff

Jeff D.

Certified Architect LabVIEW Champion DQMH Framework

0 Kudos
Message 5 of 6
(6,463 Views)

Hi jdebuhr,

Thanks for asking. NO i tried different way. I use "Read from Text File" and than parse

required string via Match Pattern. Thanks you guys...I learn some more now.

0 Kudos
Message 6 of 6
(6,463 Views)