LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a tdm file from a txt file containing a column vector of numbers?

Hello,

 

I am trying to create a noise source in multisim, so I decided to create a source from a file. The problem is that the file has to be in tdm format, which I cannot seem to get. Any help would be appreciated!

0 Kudos
Message 1 of 6
(2,626 Views)

You can create a DataPlugin (see ni.com/dataplugins or use the DIAdem DataPlugin Wizard) to read your txt file. Then use the "Convert to TDM or TDMS VI" from the Storage/Dacan taPlugin VIs Palette to convert the file to TDM.

 

OR

 

You can try to make an LVM file out of your txt file (see LVM spec) by adding an LVM header on top and use a LVM source instead (please consider changing seperators accordingly, please note Delta_X (see red marks)):

 

LabVIEW Measurement    
Writer_Version    2
Reader_Version    2
Separator    Tab
Decimal_Separator    ,
Multi_Headings    Yes
X_Columns    No
Time_Pref    Relative
Operator    operator
Date    2014/03/06
Time    16:21:54,0805568695068359375
***End_of_Header***    
    
Channels    1    
Samples    100    
Date    2014/03/06    
Time    16:21:54,0805568695068359375    
X_Dimension    Time    
X0    0,0000000000000000E+0    
Delta_X    0,001000    
***End_of_Header***        
X_Value    Sine    Comment
    0,000000
    0,063418
    0,126580
    0,189233

 

 

 

0 Kudos
Message 2 of 6
(2,615 Views)

I think doing the LVM is easier then, thank you. Once I add the header to the top of my text file, how could I convert that file to lvm format?

0 Kudos
Message 3 of 6
(2,554 Views)

I wrote a vi to convert my comma delimited oscilloscope data and then plot.  You should be able to modify it for any delimiter you choose from within the Read From Measurement File Express VI.

0 Kudos
Message 4 of 6
(2,547 Views)

Thanks that really helped and I got the right result on the scope. For some reason, however, when I upload the tdms file to the tdms source on multisim, it is not outputting the same thing as it is on labview. Could you help me out with that?

0 Kudos
Message 5 of 6
(2,530 Views)

Sorry, my mistake.  I just noticed you were looking to convert to .tdm.  My vi converts text file to .tdms file (purely binary data).  Your application requires a .tdm file which has an xml header (from my understanding anyway).  This is almost certainly the reason for the discrepancy.  I don't have the vi in front of me, but I will see if I can easily modify the vi to output .tdm when i get back to the office tomorrow.

0 Kudos
Message 6 of 6
(2,508 Views)