Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Converting XML to LabVIEW Data

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

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.

Complete the following steps to convert an XML string to LabVIEW data.

  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 from the shortcut menu to create 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.

Refer to the labview\examples\File IO\XML\Flatten and Unflatten XML\Flatten and Unflatten XML.lvproj for examples of converting XML to LabVIEW data.


 Was this document helpful?  submit
  Helpful Not Helpful