资源简介
用Matlab打开tdms文件,为后续数据处理奠定基础。
代码片段和文件信息
clc;
%Recreate needed property constants defined in nilibddc_m.h
DDC_FILE_NAME = ‘name‘;
DDC_FILE_DEscriptION = ‘description‘;
DDC_FILE_title = ‘title‘;
DDC_FILE_AUTHOR = ‘author‘;
DDC_FILE_DATETIME = ‘datetime‘;
DDC_CHANNELGROUP_NAME = ‘name‘;
DDC_CHANNELGROUP_DEscriptION = ‘description‘;
DDC_CHANNEL_NAME = ‘name‘;
%Check if the paths to ‘nilibddc.dll‘ and ‘nilibddc_m.h‘ have been
%selected. If not prompt the user to browse to each of the files.
if exist(‘NI_TDM_DLL_Path‘‘var‘)==0
[dllfiledllfolder]=uigetfile(‘*dll‘‘Select nilibddc.dll‘);
libname=strtok(dllfile‘.‘);
NI_TDM_DLL_Path=fullfile(dllfolderdllfile);
end
if exist(‘NI_TDM_H_Path‘‘var‘)==0
[hfilehfolder]=uigetfile(‘*h‘‘Select nilibddc_m.h‘);
NI_TDM_H_Path=fullfile(hfolderhfile);
end
%Prompt the user to browse to the path of the TDM or TDMS file to read
[filepathfilefolder]=uigetfile({‘*.tdm‘;‘*.tdms‘}‘Select a TDM or TDMS file‘);
Data_Path=fullfile(filefolderfilepath);
%Load nilibddc.dll (Always call ‘unloadlibrary(libname)‘ after finished using the library)
loadlibrary(NI_TDM_DLL_PathNI_TDM_H_Path);
%Open the file (Always call ‘DDC_CloseFile‘ when you are finished using a file)
fileIn = 0;
[errdummyVardummyVarfile]=calllib(libname‘DDC_OpenFileEx‘Data_Path‘‘1fileIn);
%Read and display file name property
filenamelenIn = 0;
%Get the length of the ‘DDC_FILE_NAME‘ string property
[errdummyVarfilenamelen]=calllib(libname‘DDC_GetFileStringPropertyLength‘fileDDC_FILE_NAMEfilenamelenIn);
if err==0 %Only proceed if the property is found
%Initialize a string to the length of the property value
pfilename=libpointer(‘stringPtr‘blanks(filenamelen));
[errdummyVarfilename]=calllib(libname‘DDC_GetFileProperty‘fileDDC_FILE_NAMEpfilenamefilenamelen+1);
setdatatype(filename‘int8Ptr‘1filenamelen);
disp([‘File Name: ‘ char(filename.Value)]);
end
%Read and display file description property
filedesclenIn = 0;
%Get the length of the ‘DDC_FILE_DEscriptION‘ string property
[errdummyVarfiledesclen]=calllib(libname‘DDC_GetFileStringPropertyLength‘fileDDC_FILE_DEscriptIONfiledesclenIn);
if err==0 %Only proceed if the property is found
%Initialize a string to the length of the property value
pfiledesc=libpointer(‘stringPtr‘blanks(filedesclen));
[errdummyVarfiledesc]=calllib(libname‘DDC_GetFileProperty‘fileDDC_FILE_DEscriptIONpfiledescfiledesclen+1);
setdatatype(filedesc‘int8Ptr‘1filedesclen);
disp([‘File Description: ‘ char(filedesc.Value)]);
end
%Read and display file title property
filetitlelenIn = 0;
%Get the length of the ‘DDC_FILE_title‘ string property
[errdummyVarfiletitlelen]=calllib(libname‘DDC_GetFileStringPropertyLength‘fileDDC_FILE_titlefiletitlelenIn);
if err==0 %Only proceed if the property is found
%Initialize a string to the length of the property value
pfiletitle=libpointer(‘strin
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\32-bit\
文件 2306048 2009-10-20 03:48 MATLAB TDM Example\dev\bin\32-bit\dacasr.dll
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\32-bit\DataModels\
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\32-bit\DataModels\USI\
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\32-bit\DataModels\USI\1_0\
文件 18725 2009-10-20 03:44 MATLAB TDM Example\dev\bin\32-bit\DataModels\USI\1_0\usi_1_0.xsd
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\32-bit\DataModels\USI\TDM\
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\32-bit\DataModels\USI\TDM\1_0\
文件 6032 2009-10-20 03:44 MATLAB TDM Example\dev\bin\32-bit\DataModels\USI\TDM\1_0\USI_TDM_1_0.xm
文件 24470 2009-10-20 05:16 MATLAB TDM Example\dev\bin\32-bit\em
文件 839680 2008-10-15 17:03 MATLAB TDM Example\dev\bin\32-bit\hdf5dll.dll
文件 143360 2010-01-29 17:51 MATLAB TDM Example\dev\bin\32-bit\nilibddc.dll
文件 671744 2008-10-16 17:02 MATLAB TDM Example\dev\bin\32-bit\stlport.5.0.dll
文件 516608 2009-05-25 04:32 MATLAB TDM Example\dev\bin\32-bit\tdms_ebd.dll
文件 602112 2009-10-20 03:52 MATLAB TDM Example\dev\bin\32-bit\uds.dll
文件 2591 2009-04-23 17:02 MATLAB TDM Example\dev\bin\32-bit\USI_STLport_Notice.txt
文件 11560 2009-04-23 17:02 MATLAB TDM Example\dev\bin\32-bit\USI_Xerces_License.txt
文件 570 2009-04-23 17:02 MATLAB TDM Example\dev\bin\32-bit\USI_Xerces_Notice.txt
文件 880640 2009-10-20 03:53 MATLAB TDM Example\dev\bin\32-bit\usiEx.dll
文件 655360 2009-10-20 03:51 MATLAB TDM Example\dev\bin\32-bit\usiPluginTDM.dll
文件 786432 2009-10-20 03:54 MATLAB TDM Example\dev\bin\32-bit\uspTdms.dll
文件 1888256 2008-10-15 17:08 MATLAB TDM Example\dev\bin\32-bit\xerces-c_2_8_usi.dll
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\64-bit\
文件 3460096 2009-10-20 04:47 MATLAB TDM Example\dev\bin\64-bit\dacasr.dll
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\64-bit\DataModels\
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\64-bit\DataModels\USI\
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\64-bit\DataModels\USI\1_0\
文件 18725 2009-10-20 03:44 MATLAB TDM Example\dev\bin\64-bit\DataModels\USI\1_0\usi_1_0.xsd
目录 0 2010-04-30 17:54 MATLAB TDM Example\dev\bin\64-bit\DataModels\USI\TDM\
............此处省略46个文件信息
相关资源
- 卷积神经网络matlab代码下载153575
- MATLAB小波变换.pdf
- 《MATLAB GUI设计学习手记(第2版)》
- 现代永磁同步电机控制原理及MATLAB仿
- MATLAB车牌识别课程设计源码(带界面
- Matlab GUI 编程
- 《matlab算法大全》pdf+源码
- 《MATLAB优化算法案例分析与应用》p
- 《有限元方法及MATLAB编程》pdf电子书
- SAR图像分类识别(matlab)
- MATLAB图像配准
-
电力系统的MATLAB SIMUli
nk仿真与应用 - 无线传感器网络无需测距定位算法m
- 复杂网络MATLAB工具包和源程序(好不
- matlaB程序的有限元法解泊松方程
- 《MATLAB统计分析与应用:40个案例分析
- MATLAB时频分析程序和演示(有几百个
- 《MATLAB R2016a神经网络设计与应用28个
- 基于MATLAB的雷达信号处理
- 基于MATLAB的雷达数字信号处理(源码
- 《雷达系统设计MATLAB仿真(英文版)
- 《雷达系统设计MATLAB仿真》pdf
- 遥感图像几何纠正matlab编程
- 电力电子技术与Matlab仿真(pdf)
- 精通MATLAB图像处理(2015代码)
- 数字图像处理的MATLAB实现
- matlab神经网络30个案例
- Matlab指纹识别 程序源码
- 深度学习的matlab的工具包(DeepLearnT
-
王正林《Matlab Simuli
nk与控制系统仿
评论
共有 条评论