LabVIEW MathScript RT Module

cancel
Showing results for 
Search instead for 
Did you mean: 

Converting *.TDM to *.mlv

Me not a LabView man - But need to know how to convert .TDM file to .mlv - i.e. how to write tdm to mlv?
Cheers
0 Kudos
Message 1 of 5
(7,234 Views)
Hello,

It is not currently possible to perform the conversion you request.  Can you describe in more detail what you wish to accomplish?  I can then suggest an appropriate workaround.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 2 of 5
(7,219 Views)

Unfortunately I can't help with your question, but I suspect this question is not MathScript-related, and if so, you would have better luck posting it in the main LabVIEW forum.

If it was specific to MathScript, please refer to GrantM's reply - he may need some more information to help you.

0 Kudos
Message 3 of 5
(7,215 Views)

Hi Grant,

Thankx for the quick response.

I'm currently developing an algorithm using MathScript (learning it as I go ofcourse) - while collecting a large amount of data (30 channels with up to 45K sampling rate & 3sec in length - which is a must) using LabView in realtime. I'm just wondering whether it is possible to take/convert/or write-to  partially analysed .TDM files to .mlv for further analysis using MathScript. Can't even think about saving data in MathScript Node while the program is running in realtime - toooooooSlow!!

Cheers

 

0 Kudos
Message 4 of 5
(7,210 Views)
As Jeff B alluded to, this forum focuses on MathScript.  I can provide information on how to get your data into MathScript for analysis, but for more details on reading the TDM files, you may want to ask in the main LabVIEW forum.  The storage VIs are located on the Programming » File I/O palette.  They will allow you to open and read from a TDM file.  The help will lead you to examples on how to use the VIs.  The easiest method is to read in all channels and pass them to a MathScript node.  The MathScript node does not accept the waveform datatype, though.  Maybe you want each channel to be a separate variable in MathScript.  If so, wire each set of channel data to a separate input on the MathScript node.  In the MathScript node, you can simply type

save filename

in order to save your data to an MLV file of your choosing.  If this method becomes unwieldy for large channel sets (and all channels have the same data length), you can pass all channels into the MathScript node as a 2D array or matrix.  You can also pass in an array of variable names (if they are the same length).  Simply strip off rows or columns as appropriate, build an appropriate assignment statement, and execute it with the eval command.  For example, if data is a matrix with one channel per column and names is an array of variable names, you could implement a conversion in MathScript as follows:

for i=1:length(names)
    str = [names(i) ' = data(:, i);'];
    eval(str);
end


Then you could save the data as previously mentioned.

Grant M.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
0 Kudos
Message 5 of 5
(7,201 Views)