06-09-2014 06:38 AM - edited 06-09-2014 06:45 AM
Wonder can someone help me unflatten from an xml array. The xml file I want to unlfatten from is attached. The unflatten type I want is an array of clusters but I can't get the elements right in the cluster.
The XML file is uploaded in Text format because .xml isnt a valid upload format
My VI is also attached
06-09-2014 07:24 AM
Your XML file might have been a different data type than the reading cluster. I did get the XML reading error when giving your file as an input.
Having said that i was able to create and read the XML file with your cluster.
Please find the attached VI snippet
06-09-2014 07:30 AM
Thanks for your help Vijay_J
Could you upload your working Vi please?
06-09-2014 07:35 AM
Drag and Drop the "XML Cluster.png" into LabVIEW Blockdiagram. It will Generate the code from the VI snippet (*.png file).
06-09-2014 07:42 AM
I'm getting the error code 1102 "The XML input string is empty". The read xml file isn't outputting any value to be unflattened
06-09-2014 07:55 AM
Are you trying to create a file using the write portion of code and then reading the same file with the read portion of the code?
Even i got the same error when trying to read your XML file. I guess it may be due to type mismatch.
06-09-2014 08:00 AM
06-09-2014 08:36 AM
I would suggest you to create "Type Def" Control of cluster and use it in XML file read as well as Write portion of the Source code. This will ensure both the code access the same data type and change in the "Type Def" control will reflect in both the places.
Even if the order of the element change in two write and read cluster can cause issues.
06-09-2014 08:53 AM
How would I use the type def in the read of the xml file?
06-09-2014 09:56 AM
The array you wire to the unflatten from XML should be an array of your type def'd cluster.
/Y