08-20-2008 08:29 PM
Dear all....I'm quite new to LABView and all the more greener in embedding MATLab .m files within LABView. I've been having problems trying to decode what is wrong with my code and have been wondering if it is a limitation of LABView MathScript although everything is running perfectly fine in MatLab. Basically, what I am trying to do is to embed a .m file into my custom LABView application. The .m file has commands to extract decimal data from another file. To give you a clearer picture, my code is as follows:
See attached file for the code.The error message I keep getting is "Error90001 occured at Error in function feof at line 2. A problem occured with a subVI call". I attempted to comment out the while loop & end command but then it will complain the same message just indicating that error has occured with feof.
Any help (esp. gurus) is much appreciated. Thanks
08-21-2008 11:57 AM
kilo5k,
I believe your problem may be related to dangling file references. Your code has a fopen, but does not have a corresponding fclose. I suspect that the file gets opened the first time you run, but then cannot be reopened on subsequent runs. If you add fclose('all') to the beginning of your script, I believe your script may work, assuming that the file 'C:\work\demodata1.m' exists.
You may want to take a look at the function Read From Spreadsheet File.vi, it might be an easier way to accomplish what you are trying to do.
Best of luck,
Kevin C.
Staff Software Engineer | LabVIEW Math & Signal Processing | National Instruments
08-21-2008 11:50 PM
08-22-2008 09:46 AM
What aspect of your computer specifically is slowing down? If you post an example I can take a look at it.
Kevin C.
08-24-2008 08:19 PM
08-25-2008 12:04 PM
Could you please attach the program you are talking about so that I can take a look at it?
Thanks,
Kevin C.
08-26-2008 09:32 PM
Hi KevinC, have been racking my brains out on this problem and I seem to have solved it.All along, the MathScript node (formulas+file_handling) were within a while loop. As such, I must have made the LABView compiler confused. I had also reverted back to an earlier version of the file I was working on is fine now. Managed to get the LABView compiler unconfused by putting the filehandling sections of the MathScript node outside the while loop.Many tks for being of assistance...