02-14-2024 03:23 AM - edited 02-14-2024 03:28 AM
Hi,
I was trying to create a LabVIEW program that will grab waveform data from Tektronix MSO64 and save it into .mat file for data processing in MATLAB.
So far I managed to save the scope data into csv file (as shown in the image below).
However, I was just wondering if there's a way to save the 2D array into .mat file in LabVIEW so I can directly process the data in MATLAB, without having to do csv to mat conversion in MATLAB?
Thanks.
02-14-2024 08:55 AM
Look on VIPM. There are two libraries for H5; theu can be used to create Matlab files. (.mat is basically a H5 file)
02-14-2024 09:34 AM
You can use MATLAB DataPlugin with LV's Data Storage Express VIs.
02-14-2024 11:11 AM
@santo_13 wrote:
You can use MATLAB DataPlugin with LV's Data Storage Express VIs.
Versions of this Plugin exist (only) for LabVIEW 2019 and LabVIEW 2021, and appear to require at least the Full (which means that Professional and Academic licenses should also work).
Bob Schor
02-16-2024 02:54 AM
I have installed the plugin and attempted to create a .mat file using the storage VI. However, I was getting some strange data when I open the file in Matlab. The Signal input on Write Data VI only accept unsigned byte array so maybe I was doing something wrong in the data conversion. I have seen other forum post saying that it's tricky to use Matlab dataplugin, because it is trying to force the .mat file to be like a .tdm file. (https://forums.ni.com/t5/LabVIEW/Creating-mat-files-with-Matlab-dataplugin-in-LabVIEW/td-p/1678970)
Also, I have found an example code from this forum post (https://forums.ni.com/t5/Example-Code/Convert-File-to-MAT/ta-p/3492051) to convert files into .mat. I have tried the code and it does the job! But so far I only managed to save a 2D array and I'm still looking if it's possible to save multiple 2D array as struct in Labview.
FYI, MSO64 save data storageVI.vi is the one I tried to use Matlab dataplugin and the con2mat is the one with example code.