Example Code

Parsing Data from an Arbitrary (.n42) XML format

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This example is a tool to parse a custom XML file. Instead of crawling through each section programmatically, it searches for a tag name and delivers the content listed in that node.


Description
This specific example was created to read an N42 xml file, an industry-specific XML scheme (.xsd) which made it difficult to navigate programmatically. When opening the xml files to view them, it became apparent that there were large chunks of data stored in specific categories, such as "Data, Coefficients, or ChannelData". To access these chunks of data, we type in the name of the category and browse to open that XML file.


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Rename .n42 or other xml file to .xml  extension
  2. Paste into same directory as VI
  3. Enter Tag Name for desired information

 

Additional Information or References
VI Block Diagram

 Block Diagram.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Joey S.
Senior Product Manager, Software
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.