LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

XML array

I have a test channel cluster of 4 int values, 4 dbls, 1 enum and 1 boolean. Each cluster I flatten and save as an XML file. Flattening and saving and reading and unflattening are no problem. However, I have a 4x5 array of these clusters (20 test channels in all) and I want to flatten and save all these channels under the same xml file. Is there any way I can save an array of clusters with XML?
 
Paul
7.1
PaulG.
Retired
0 Kudos
Message 1 of 4
(2,775 Views)
Hello,
 
Can you save them each individually to that file?  It sounds like you are really searching for a way to represent your array in an XML file, and I think that will be a design choice.  If I have misinterpreted something, definitely repost!  Perhaps you could have separate tags at the same level for each element of the array.
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 2 of 4
(2,759 Views)
I need all the test channel data in the same file.
 
However, I think I solved my own problem. I'm testing it now. My test clusters are in a 1x20 array and I flatten to XML in a for 20 loop, cancantenate the output XML strings and save to the file. When I want to load my array from disk I read the XML file and index the XML elements as an array in a FOR 20 loop and use it to load my test data array. This XML is a little tricky since elements act like arrays but you can't auto-index and that threw me off a little. I'll keep you posted!
 
Paul
PaulG.
Retired
0 Kudos
Message 3 of 4
(2,756 Views)
Hello,
 
That's great, in fact, that is essentially what I was suggesting when I wrote "Perhaps you could have separate tags at the same level for each element of the array."  Basically, you have a separate section of xml for each element of your array, which in this case is a cluster.
 
I hope your tests conclude with success of your solution!
 
Best Regards,
 
JLS
Best,
JLS
Sixclear
0 Kudos
Message 4 of 4
(2,742 Views)