Convert XML to LabVIEW data to use the data within the XML file within a VI.

The XML string you want to convert to LabVIEW data must conform to the LabVIEW XML schema. You cannot convert more than one data type from an XML string.

Fo convert an XML string to LabVIEW data, complete the following steps.

  1. Add the Unflatten From XML function to the block diagram.
  2. Wire the XML string that contains the data you want to convert to the xml string input of the Unflatten From XML function.
  3. Specify the data type of the data in the XML string by wiring a constant or control to the type input of the function.
    For example, if the XML string is an array of double-precision, floating-point numbers, wire that data type to the type input.
  4. Right-click the value output of the function and select Create » Indicator.
    This creates an indicator of the same data type as the type input. A block diagram indicator terminal appears, and a front panel indicator appears.
  5. Run the VI.
    LabVIEW converts the xml string to a LabVIEW data type of type according to the LabVIEW XML schema. The value indicator displays the LabVIEW data.

Converting XML to LabVIEW Data Examples

For examples of converting XML to LabVIEW data, refer to labview\examples\File IO\XML\Flatten and Unflatten XML\Flatten and Unflatten XML.lvproj.