Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Converting XML to LabVIEW Data

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-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.

Note  Although you can flatten LabVIEW variant data to XML, attempting to unflatten variant data from XML results in an empty LabVIEW variant.

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\XMLex.llb for examples of converting XML to LabVIEW data.


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit