Code covered by the BSD License  

Highlights from
National Instruments (NI) XML reader for Matlab

5.0

5.0 | 1 rating Rate this file 13 Downloads (last 30 days) File Size: 4.72 KB File ID: #43726

National Instruments (NI) XML reader for Matlab

by

 

Two functions: one for printing and one for reading into a struct an National Instruments XML file

| Watch this File

File Information
Description

Requires Matlab's xmlread.m function
read_ni_xml_object.m
print_ni_xml_object.m
example.xml

MATLAB release MATLAB 7.13 (R2011b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
24 Feb 2014 Ian

This is still a great submission, but I have found a bug either in the script or in LabVIEW 2009's XML implementation. If I create an XML file in LV containing only an array, usually I get a block that looks like this:

<Array>
<Name>Decimated Array</Name>
<Dimsize>800</Dimsize>
<DBL>
<Name></Name>
<Val>20.03500875218805</Val>
</DBL>
<DBL>
<Name></Name>
<Val>20.12253063265817</Val>
</DBL>
</Array>

But sometimes I get this instead:

<Array>
<Name>Decimated Array</Name>
<Dimsize>800</Dimsize>
<DBL>
<Name>Numeric</Name>
<Val>20.03500875218805</Val>
</DBL>
<DBL>
<Name>Numeric</Name>
<Val>20.12253063265817</Val>
</DBL>
</Array>

and when the script comes across the word 'Numeric', it thinks that it's no longer an array and over-writes the previous value.

In my copy, I've modified line 86 to read:

if isempty(name) || strcmp(name,'Numeric')

Since I'm new to using the XML file format with LV, I don't know how general this fix is going to be.

I still stand by my 5 stars, though.

22 Feb 2014 Ian

Works great with LabVIEW 2009. This just saved me so much time and headache.

Contact us