LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to unflatten xml data?

I am flattening data to a xml file.  the data consists of strings and numeric values.  when I try to unflatten the xml file, i am having problems with figuring out what kind of output is needed to display the data.  when i use the "unflatten from xml" block and then use the default " create ---> indicator,  it produces a cluster.  i then put the indicators in to match the inputs but there is still a wiring error.  can anyone give an example of how to unflatten the xml data of different types?
Thank you
0 Kudos
Message 1 of 5
(5,490 Views)
Unflatten from XML contains an input called Type. It accepts any LabVIEW datatype. Simply wire in a dummy constant of the cluster datatype that is stored in the XML file, and then create the indicator. You will see the indicator will automatically be the right type. Hope this helps!
Jarrod S.
National Instruments
Message 2 of 5
(5,479 Views)
I tried to use a dummy cluster but still i am unable to get the separated data.  i attached a small example with the type and output of the xml data if you can show me what you mean.  thanks
Download All
0 Kudos
Message 3 of 5
(5,471 Views)
Ifoitek,
 
I modified your example to do what I think you want it to do.  The key is to separate the XML data first and then unflatten the data.  I used a VI that I found inside the "Read from XML File" vi called "ParseXMLFragments.vi" to do this for me.  Once I separated the data I was then able to use the unflatten vi to get the data back out.  I've attached the code that I've modified to this post.
 
I hope this helps,
Justin D.
Applications Engineer
National Instruments
Message 4 of 5
(5,435 Views)
thank you, it is what i needed.
0 Kudos
Message 5 of 5
(5,427 Views)