Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can Matlab be used to read TDM (technical data management) files?

 
I run your example code , but have problems
 
some code like this:
 
tdmfile = 't.tdms';
pfile = libpointer('int32Ptr', 0);
if calllib('nilibddc','DDC_OpenFileEx', tdmfile, 'TDMS', 1, pfile) ~= 0
    disp ('TDM-file could not be loaded!');
end

plen = libpointer('uint32Ptr', 0);
calllib('nilibddc', 'DDC_GetFileStringPropertyLength', pfile.Value, 'name', plen);
    
when matlab run to last line ,returns
-6206 which means DDC_InvalidFileHandle
.
can you  help me ?thanks!


帖子被iBiR在05-05-2008 07:18 AM时编辑过了
0 Kudos
Message 11 of 18
(2,135 Views)
Can you please tell which version of Matlab you are using.
0 Kudos
Message 12 of 18
(2,124 Views)
I have tested it under both matlab 2007a ang matlab 2008a.they all have same problem
0 Kudos
Message 13 of 18
(2,111 Views)
tdmfile = 't.tdms';
pfile = libpointer('int32Ptr', 0);
if calllib('nilibddc','DDC_OpenFileEx', tdmfile, 'TDMS', 1, pfile) ~= 0
when matlab run to this line ,returns
0 which means success

    disp ('TDM-file could not be loaded!');
end

plen = libpointer('uint32Ptr', 0);
calllib('nilibddc', 'DDC_GetFileStringPropertyLength', pfile.Value, 'name', plen);
    
but when matlab run to last line ,returns
-6206 which means DDC_InvalidFileHandle

 

how can I fix the problem?thanks   

 

using matlab R2007a

0 Kudos
Message 14 of 18
(2,094 Views)
Hi,

I am trying to extract furtther information from a tdm file like the data type of a channel and the actual data itself. However, I get an error stating a pointer mismatch. I am using the statements:

ptype=libpointer('voidPtr',uint8(0));
calllib('nilibddc','DDC_GetDataType',pchans.Value(1),ptype);

to get info about the first of 7 channels. The function DDC_GetDataType returns an numerated data type (DDCDataType). Could someone please advise? Can anyone maybe direct me to an example for this?

Regards,
SVJ

P.S: Extensive Googling has also failed to solve the problem.
0 Kudos
Message 15 of 18
(1,978 Views)
Hi,
 
it might be that the ptype should be declared as:
ptype = libpointer('int32Ptr', 0);
0 Kudos
Message 16 of 18
(1,973 Views)
Hello Stefan

Many Thanks. I have tried that too. Unfortunately that does not work. Also, I did not mention it previously but I am using R14 SP3.

Regards,
0 Kudos
Message 17 of 18
(1,969 Views)

For anyone who is interested, this discussion has been continued here.

Chris M

0 Kudos
Message 18 of 18
(1,922 Views)