LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Saving output data in LabVIEW using Matlab Script

Hello,

 

I would like to save all the 1000 data points that are plotted out of the matlab script node in an array/file. At present it is only saving the last data point.

How do I do it?

 

I would like to get atleast 4 sets of data (the whole program runs inside a for loop) saved.

 

My final goal would be to test the data using neural network and plot the results.

 

All these would be done using Matlab script.

 

Attached are the LabVIEW program and the screenshot of the 1000 data points.

 

Thanks,

Haritha

Download All
0 Kudos
Message 1 of 2
(2,510 Views)

It's only plotting the last point because the wire that goes from the loop to the Write to Measurement File is not filled with data until the loop ends. Since you do not have auto-indexing enabled, it will only have the data from the last run. You can enable auto-indexing on the for-loop (which will give you a 2D array), or you can place the write file operation inside the loop. Please review the Help File on for-loops.

 

That said, what is the purpose of the for-loop? You only have it set to 1.

 

How are you running your VI? I see no loop. Are you using the "Run Continuously" button. If so, STOP. That is not meant to be used for normal operation. It is meant to be used for specific debugging. Using that is the same as clicking the Run button each and every time. Your VI start everything from scratch.

 

Aside: I do not see the need for the Matlab code. You can do the same thing in LabVIEW, without incurring the cost of running Matlab outside of the LabVIEW process. In fact, using it will require that whatever machine runs this VI must also have Matlab installed.

0 Kudos
Message 2 of 2
(2,502 Views)