11-22-2008 03:16 PM
Hi,
I currently have a bit of Matlab code that imports a load of data from a tab-delimited text file. The text file is in the same directory as the .m file and my .vi file. The relevant line of import code from Matlab is:
data=dlmread('data.txt','\t',5,0);
When I run this in Labview after importing the code into a Mathscript block and connecting two relevant outputs to a "Build XY Graph" block such that the variables can be plotted, I get a message saying:
"Error -90001 occured at Error in function dlmread at line 10. Labview: File not found..."
How can I get LabVIEW to read the file? Sorry if this is a stupid question but I'm new to LabVIEW, having come from Matlab!
Thanks for the help 🙂
11-22-2008 03:28 PM
11-22-2008
11:31 PM
- last edited on
05-21-2024
07:07 PM
by
Content Cleaner
Hi,
Looks like that you are using relative path. Then, the file must be located in MathScript search path. Otherwise, MathScript can not find that file. You can either specify the absolute path or add the path to MathScript search path list.
I have tried in LabVIEW 8.6. dlmread should work well to read data from .txt file.
11-23-2008 04:06 AM
Hi,
Thanks for the reply. I also tried putting in the path as dlmread('C:\My Documents\...\data.txt') and it still wouldn't find it... is that what you meant by the absolute path?
11-23-2008 07:20 PM - edited 11-23-2008 07:21 PM
Hi,
I have no idea why it does not work on your machine. Would you please attach your script and data file?
And, which version of LabVIEW do you use?