How can I read TDMS data that is streamed through a UDP socket using MATLAB 7.9 (R2009a) ?

2 views (last 30 days)
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.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 23 Feb 2021
Edited: MathWorks Support Team on 23 Feb 2021
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.

More Answers (0)

Categories

Find more on Data Acquisition Toolbox Supported Hardware in Help Center and File Exchange

Products


Release

R2009b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!