Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Sharing Data between LabVIEW MathScript and Other Applications (MathScript RT Module)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

You can share data between LabVIEW MathScript and other applications by reading and writing files. MathScript supports several file formats, including .mlv, .mat, .csv, .txt, .tdm, .tdms, and .xsl, that other programs recognize. Use the load function to import variables or data into a MathScript Node or the LabVIEW MathScript Window. Use the save function to export variables to a file. In the LabVIEW MathScript Window, the Operate»Load Data and Operate»Save Data menu items support the same file formats as the load and save functions.

Note  MathScript does not support saving data to .mat files. If you load data from a .mat file into the LabVIEW MathScript Window or a MathScript Node, you can save this data as a .mlv file.

MathScript also provides functions to read and write to specific file formats. For example, the fread_xls and fwrite_xls functions read and write to a Microsoft Excel spreadsheet file. You can use functions from the support class to read and write to several file formats. If you want to read or write custom file formats for binary or text files, you can use the fread and fwrite functions.

If you want to share data without using files, you can copy data from the LabVIEW MathScript Window or the MathScript probe to the clipboard as tab-delimited text, and then paste this text to a text editor or spreadsheet program. To copy data from the LabVIEW MathScript Window or the MathScript probe, select a variable in the Variable List, and then right-click the data in the Preview Pane and select Copy Data from the shortcut menu. You also can copy textual data directly from the Output Window of the LabVIEW MathScript Window or the Output tab of the MathScript probe.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit