LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XML file data

Solved!
Go to solution

Hello

The attached xml file contains data that I would like to extract. The data value has the tag (ubchild???/)name of "mean'. This can occur quite a number of times within the file for different child names.  e.g.

 

<Key>SENS0710:10951:IntSolIrr</Key> has the value as

 

<Mean>742.320755</Mean>

 

and

 

<Key>SMBAU008:154000347:m_S0 kWh</Key> has the value as

 

<Mean>227.458679</Mean>

 

and so on....

 

The attached vi is very very simple and uses the JKI EasyXML vi to parse the file to a labview data type.

 

This is the point at which I need some guidance as to move forward. I have looked at using variant to data, clusters etc, but can't seem to get anything near working.

 

Would somebody be so kind as to give me some advice or tips as to extract these values to an array.

 

Thankl you

 

Regards

Ray

Download All
0 Kudos
Message 1 of 22
(4,816 Views)
Solution
Accepted by topic author rayclout

Hi rayclout,

  I dont have JKI Xml parser vi..But i used the default XML functions and could able to read the mean tag.Please find the screenshot of it.

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


Message 2 of 22
(4,805 Views)

Hello srikrishnaNF

Thank you

I had found the multiple node search vi at the same time as your post.

 

It was enough for me to get a simplified vi working, along with your png.

 

I have attached the vi for any other who may want to use it.

 

I will give you the kudos

 

Thanks again

Ray

0 Kudos
Message 3 of 22
(4,793 Views)

Hey Ray,

 

Here's how you use EasyXML to parse your data (Parse WebBox XML.vi😞

 

1-26-2011 8-37-03 PM.png

 

1-26-2011 8-38-48 PM.png

 

 

0 Kudos
Message 4 of 22
(4,704 Views)

Thanks Jim

I did get a solution working, but your method is much more elegant and less code intensive, so If I may, I will use your method.

 

Best regards

Ray

0 Kudos
Message 5 of 22
(4,696 Views)

Hey Ray,

 

Sure, feel free to use whatever example code I posted.


Yes, I think you'll find that the EasyXML approach is much simpler to set up and maintain.  Personally, I find using the XML DOM API to be hard.

 

Cheers,

 

-Jim

0 Kudos
Message 6 of 22
(4,692 Views)

Hello again Jim

 

One question please....the item with the pink string surround marked as WebBox. I've not seen this before. Could you explain it's use.

 

Regards

Ray

0 Kudos
Message 7 of 22
(4,688 Views)

That is a cluster.  A programmer defined datatype.

 

I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours

 

0 Kudos
Message 8 of 22
(4,681 Views)

That's a local variable of the WebBox cluster Indicator.  It's used to get the datatype for EasyXML to use when parsing the XML data -- then, we convert the variant back into that same datatype.  This is the one part of EasyXML that could be made easier someday (maybe by using the magic of XNodes)

0 Kudos
Message 9 of 22
(4,676 Views)

 


One question please....the item with the pink string surround marked as WebBox. I've not seen this before. Could you explain it's use.


You probably got confused by the different look of a local variable in LabVIEW 2010 in comparison to earlier versions. It's meant to be less diagram consuming and I think a good change, though it does require some getting used to.

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 10 of 22
(4,663 Views)