LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can Matlab read TDM files?

We are considering using TDM storage vi's to save data acquired by a Compressor Monitoring System. Many channels will be scanned, some at a relatively high rate (>5 kHz) for many hours resulting in a large data set. We would like to use Matlab to post-process some of this data. We know that an add-in exists for Excel. Does one exist for Matlab? If not, is it possible to write a simple Matlab function that can read the header file and the binary data?
0 Kudos
Message 1 of 5
(5,449 Views)
 

TDM is an XML format with embedded binary (when saved as binary), so you should be able to write a Matlab reader without too much difficulty.  You can get information on TDM here.  Other alternates you can try are

  • Simple binary file - stream to disk using interleaved or multiple flat binary files.  This is relatively easy to do, but if you have many channels (which you indicate you do), it may require a fair amount of effort.  LV8.0 supports file sizes over 2GBytes directly.  LV7.1 and earlier supports files sizes over 2GBytes on NTFS file systems under Windows XP or 2000, if you do it correctly.  See the tutorial mentioned below for details.
  • NI-HWS - designed for fast binary streaming and available on the driver CD under the computer based instruments tab.  The root technology is HDF5, which Matlab, in theory, supports.  However, you will need to browse the file to find the structure so you can extract your data (it is similar to SCPI-DIF).  This may or may not be easier than writing an XML parser for TDM.  You can get an HDF5 browser and more info at the HDF5 website (this is not info on the HWS file structure).

How many channels will you be scanning?  5kHz is actually not that fast.  You can typically do a binary stream to disk at somewhere around 20MBytes/sec (strongly depends on your computer, especially your disk drive).  Maximum speed with a PCI bus is probably around 40MBytes/sec, assuming a very good hard drive system (RAID?).  HWS will stream at about 1MByte/sec with compression (depends on processor).

You may also want to check out the tutorial Managing Large Data Sets in LabVIEW for large data handling, and this recent thread for more information on saving in binary format using TDM.  If you need more information, please ask.  Please include more details (number of channels, bit depth, header info needed, etc.) if you can.

 
0 Kudos
Message 2 of 5
(5,435 Views)
 
Now there is a knowledgebase article describing in detail how to import TDM and TDMS files into MATLAB from the Mathworks Software.
 
ThomAC
0 Kudos
Message 3 of 5
(5,173 Views)

Hello, I try to check the knowledgebase article but can't, im 'not authorized'.

 

?

0 Kudos
Message 4 of 5
(4,477 Views)

The knowledgebase article seems to have been replaced with this new DevZone article:

https://forums.ni.com/t5/Example-Code/Reading-TDM-TDMS-Files-with-The-MathWorks-Inc-MATLAB-Software/...

 

 

Regards,

ThomAC

0 Kudos
Message 5 of 5
(4,460 Views)