LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read From XML File.vi returns empty string

Solved!
Go to solution

Hi,

I'm using Read From XML File.vi and this VI returns an empty string on my XML file, but on another XML file it seems to work fine.

I open my XML file on Internet Explorer 7.0 and it apears as aspected.

What could be the problem?

 

Thanks in advance for any help.

Regards,

 

Daniel Coelho

 

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 1 of 10
(4,637 Views)
Give me your xml file.
0 Kudos
Message 2 of 10
(4,631 Views)

Here it goes. (Please remove the .txt extension)

Thanks.

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 3 of 10
(4,630 Views)
Your XML file uses a custom schema. That function will only work if the XML file follows the standard LabVIEW XML Schema. This is specified in the LabVIEW Help for that function. The LabVIEW XML Schema is in the labview\vi.lib\Utility directory (this is also specified in the LabVIEW Help file). If you want to read/write generic XML files then you must use third-party tools to do it, such as LabXML, or EasyXML.
Message 4 of 10
(4,607 Views)

Thanks for making me aware of that XML schema.

I downloaded LabXML, because the second one was only a DEMO.

But how do I use these new VIs?

I can't make sense on how to open a file and read it.

Can you give some hints?

 

I apreciate the help.

 

Daniel Coelho

 

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 5 of 10
(4,594 Views)

Did you take a look at the example that comes with LabXML? The whole thing revolves around the custom cluster that represents a node. You need to provide a query string for "MSXML Select Nodes" to tell it where to start. This can be any node, based on XPATH syntax. For example, to read your entire XML file:

 

Message Edited by smercurio_fc on 10-06-2008 01:02 PM
0 Kudos
Message 6 of 10
(4,591 Views)

There are some examples with this package but nothing works.

I have conflicts on my project.

I atached a print screen.

Any clues on whats is the problem?

I thinks that this is exactly what I need, but I can't seem to get it to work.

 

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 7 of 10
(4,584 Views)

Luckly, I solved the problem.

Thank you for your help.

I'll start experimenting these VIs to get the one section I want from the XML file.

I'll make this post as Solved as soon as I get this working. It won't take long, I hope.

Thnk you.

 

Daniel Coelho

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 8 of 10
(4,575 Views)

Did you install MSXML? If so, you probably have a version different from the version that was used to create the library. The library uses MSXML 4.0. It's quite likely that you have MSXML 6.0. The library can be made to work with MSXML 6.0, but they would need to be relinked to the changed ActiveX interface. You can have both MSXML 4.0 and 6.0 on your computer.

 

EDIT: Post submitted before I saw your last reply indicating that you has apparently solved that problem. To get the section you want, you just need to provide the correct query string. For instance, to get the "CAN" section the string would be "/HAL/CAN".

Message Edited by smercurio_fc on 10-06-2008 02:07 PM
Message 9 of 10
(4,572 Views)
Solution
Accepted by topic author Daniel Coelho

You're correct and it seems to work as I want.

Thank you for your help, this LabXML works well.

This post is oficially solved 😉

 

My best regards,

 

Daniel Coelho

 

Daniel Coelho
VISToolkit - http://www.vistoolkit.com - Your Real Virtual Instrument Solution
Controlar - Electronica Industrial e Sistemas, Lda
0 Kudos
Message 10 of 10
(4,564 Views)