LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write XML string to file (array)?

What is the purpose of the Write XML string to File (array).vi? This polymorphic vi accepts XML srings or arrays. If I send it an array of XML data (for example, take a cluster, flatten to XML, make an array of these, then input this to the Write XML String to File.vi), it writes the file fine. But how do you read it back later? I can read the file, but the Unflatten from XML function returns an error "The XML tag describing the type of data is not recognized". Any explanation of this? Thanks!
0 Kudos
Message 1 of 4
(4,191 Views)
Hi Sal.

I am not at my work machine so I willl try to answer from memory.

Is there another input to the VI that lets you wire a cluster that the VI can use as a descriptor?

Second thought, are you un-winding the array before trying to do the "Unflatten..."?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(4,191 Views)
Simply send to graze Write to XML File and use next dataflow:

1.. Flatten to XML.vi
2.. Escape XML.vi
3.. Write Characters to File.vi
4.. Read Characters from File.vi
5.. Unescape XML.vi
6.. Unflatten from XML.vi
"sal" wrote in message
news:5065000000080000005F4D0000-1023576873000@exchange.ni.com...
> What is the purpose of the Write XML string to File (array).vi? This
> polymorphic vi accepts XML srings or arrays. If I send it an array of
> XML data (for example, take a cluster, flatten to XML, make an array
> of these, then input this to the Write XML String to File.vi), it
> writes the file fine. But how do you read it back later? I can read
> the file, but the Unflatten from XML function returns an error "The
> XML tag desc
ribing the type of data is not recognized". Any
> explanation of this? Thanks!
Message 3 of 4
(4,191 Views)
In addition to the answers above, try using the attached VI to read LabVIEW XML data fragments from an XML file written in LabVIEW.

Also, remember that Unflatten From XML only accepts an XML fragment which contains code matching the wired type.
0 Kudos
Message 4 of 4
(4,191 Views)