LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unflatten from XML Array

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

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
Download All
0 Kudos
Message 1 of 10
(4,579 Views)

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

0 Kudos
Message 2 of 10
(4,558 Views)

Thanks for your help Vijay_J 

 

Could you upload your working Vi please?

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 3 of 10
(4,548 Views)

Drag and Drop the "XML Cluster.png" into LabVIEW Blockdiagram. It will Generate the code from the VI snippet (*.png file). 

0 Kudos
Message 4 of 10
(4,540 Views)

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

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 5 of 10
(4,535 Views)

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.

 

0 Kudos
Message 6 of 10
(4,528 Views)
I'm just trying to read from the XML file and display it in the output cluster. It's the type mismatch I'm having the problem with I'm not sure of the types in the cluster to match the XML file types
----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 7 of 10
(4,521 Views)

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.

 

0 Kudos
Message 8 of 10
(4,505 Views)

How would I use the type def in the read of the xml file?

----------------------------------------------------------------------------------
I have not lost my mind, it's backed up on a disk somewhere
0 Kudos
Message 9 of 10
(4,499 Views)

The array you wire to the unflatten from XML should be an array of your type def'd cluster.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 10 of 10
(4,487 Views)