LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unflatten From XML to Cluster?

Hello All,

     I don't know if i'm just having an off day or what but I'm Working on someone else's code (3-subVI layers Deep) and it keeps giving me this Data Type Error. This VI is supposed to read/unflatten from the XML document. I've tried setting the type differently on the unflatten from XML function, i also tried adding just an indicator to see what file type it should be expecting out, and a few other things. can someone show me where i should go next with this?

 

Thank you

 

___________________________________________________________________
"I have not failed. I've just found 10000 ways that won't work." - Thomas A. Edison
0 Kudos
Message 1 of 5
(2,729 Views)

Well, let's see:

 

  • The datatype of the data that is being recovered is different from the output datatype - that's why you have a broken wire
  • There are no typedefs defined (when doing conversions like this you should always be using typedefs)
  • What does the XML data look like?

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(2,725 Views)

I was also thinking Type def. im researching how to do thise as we type, any tips? and here is the XML file it is a Machine config file (Can't upload XML converted to Text file hope thats ok)

___________________________________________________________________
"I have not failed. I've just found 10000 ways that won't work." - Thomas A. Edison
0 Kudos
Message 3 of 5
(2,720 Views)

First thing, is which of the two clusters is the data supposed to be? That is the cluster to make a typedef. A good way to see why an XML string isn't converting is to convert the cluster you think it is supposed to be into an XML string and compare them.

 

Second, once you have the typedef created you will need to modify the routine that is writing the XML string to use the same typedef.

 

Third, unless you have a really good reason for using XML, JSON strings are smaller, easier to read and also supported natively in LV2013.

 

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 5
(2,711 Views)

Solved!

 

    Thank you for your Wisdom MikePorter 🙂 it turns out what i was missing was that data type on the front had those extra integer types and one extra boolean type that the previous intern added without making use of the controls. After removing those everything connected as it should be.

 

Thank you

___________________________________________________________________
"I have not failed. I've just found 10000 ways that won't work." - Thomas A. Edison
0 Kudos
Message 5 of 5
(2,709 Views)