LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1050, when calling MATLAB 7.1 from LV8.0 - Function Definitions not allowed.

I am trying to call a MATLAB M-file from LabVIEW 8.0. I keep getting Error Code 1050:

"Error 1050 occurred at LabVIEW:  Error occurred while executing script. Error message from server: ??? Error: Function definitions are not permitted at the prompt or in scripts.

. in rickfito.vi->impedo.vi

Possible reason(s):

LabVIEW:  Error occurred while executing script"

I tried running the sample MATLAB script example on the knowledge base, and everything works fine.
I am guessing that this error is happening because I have functions defined in the MATLAB script. But i thought this is better programming techinque. Also, the MATLAB window opens up when I start the VI.
Is there a way around this? I really do not want to remove the function definitions on the script.

Thx,
Pelo...

0 Kudos
Message 1 of 3
(5,596 Views)
First, see if the Matlab Script Node is trying to open any files. If so, then make sure that the current Matlab directory is set to the directory where that file is located. The Matlab script node in LabVIEW does call the Matlab script server and executes the function in the Matlab script node through Matlab. Therefore, even though LabVIEW may be in the correct directory where the file is located, make sure Matlab is as well.

The error may also occur if there is a disruption in the script server between MATLAB and LabVIEW and the connection was never re-established (possibly by closing MATLAB prematurely). Close both LabVIEW and MATLAB then relaunch them both and run the VI.

MATLAB® is a registered trademark of The MathWorks, Inc. Other product and company names listed are trademarks and trade names of their respective companies.

-Bob
Message 2 of 3
(5,577 Views)
Hello:

This problem seemed to be persistent. I met the same problem with LV8.5.1 on Vista and with Matlab 2007b. Is there any new development in correcting this error?

Thanks.

Berns B.
Bernardino Jerez Buenaobra
Senior Test and Systems Development Engineer
Test and Systems Development Group
Integrated Microelectronics Inc.- Philippines
Telephone:+632772-4941-43
Fax/Data: +632772-4944
URL: http://www.imiphil.com/our_location.html
email: Bernardino.Buenaobra@ph.global-imi.com
Message 3 of 3
(5,310 Views)