MATLAB: How to read TDMS data that is streamed through a UDP socket using MATLAB 7.9 (R2009a)

diademInstrument Control Toolboxtcpiptdmtdmsudp

I am receiving TDMS data from a remote computer over a UDP connection. I would like to be able to parse this data within MATLAB.

Best Answer

The ability to interpret National Instruments TDM/TDMS data is not available in MATLAB. To work around this issue, refer to the following link:
Reading TDM/TDMS Files with MathWorks, Inc. MATLAB® Software
The DIAdem Connectivity Library provided by National Instruments is tailored to read from TDM/TDMS files only. However, you can read the TDMS binary data being sourced from a UDP socket (or received via TCP/IP) using the DIAdem library in a two step process:
1. Write the TDMS data to a binary file:
a. Create an empty data file with the TDM or TDMS extension using the FOPEN command.
b. Read the data from the UDP socket using the FREAD or FSCANF command as appropriate and write the data to the file created using the FWRITE or FPRINTF command.
c. Continue writing to this file until all the bytes have been received over the UDP socket.
2. Provide the above saved file as an input to the "Read_TDMData.m" example file provided along with the DIAdem library.
Related Question