LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I cannot run the matlab script node in the labview

Hi there,

 

My LabVIEW version is 8.5, and matlab version is R2008a.

 

I wrote a simple matlab code, like x= 1, y = x*2. Then I tried to put them into matlab script node in LabVIEW.

However, when I ran the program, I couldn't run and Labiew show some error. 

Then I tried the method talked before on this forum. Please see the following link.

http://forums.ni.com/ni/board/message?board.id=MathScript&thread.id=571

I followed the instruction and open the "command prompt," type some commands then I could run the program, and simultaneously, the LabVIEW program open "Matlab command line window" and run my labview code. However, if I didn't use the command prompt, the  "matlab command window" will not be opened by running the labview program. It would just show some error. And even if I turn on the matlab program in advance, I still couldn't run the labview program.

 

Is there any effecient way to deal with this problem without using "command prompt?" Because I try another PC with both matlab and labview installed on it, I "can" run my simple matlab script node on it, and it will open the matlab command line window automatically by running my code. Therefore, I thought there might be some software linking problems in the previous PC I used . Do you have any ideas?

 

Thanks in advacne.  

0 Kudos
Message 1 of 5
(4,344 Views)

Hi, and thanks for the post! I hope your well today.

 

This may help,

 

MATLAB® version 2006b (7.3) and version 2008a do work with LabVIEW 8.20. This problem can occur if a new version of the MATLAB® software is installed along with a previous installation, which is then uninstalled. The uninstallation of the older MATLAB® software results in removing the ActiveX/COM components LabVIEW uses. This can cause the MATLAB® script node in LabVIEW to stop working. There are three solutions to this problem.

  1. Uninstall the MATLAB® software and reinstall it. This should install the necessary ActiveX component.
  2. Restore the MATLAB® automation server. Browse to the \bin directory (e.g. MATLAB\R2006b\bin) and type matlab -regserver , which will reset the registry settings and start the server. The server can then be closed and the MATLAB® script node will work properly again in LabVIEW. LabVIEW may need to be restarted if VIs are open that contain MATLAB® script nodes.
  3. Leave both versions of the MATLAB® software installed.


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

 

Did you have an older version of MATLAB before 2008a?

 

Kind Regards,
James.

 

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
Message 2 of 5
(4,330 Views)

Thank you very much.

This might be the point. There are two matlab version on that PC, 2006 and 2008a. I'm not sure whether 2006 was uninstalled or not since there still a link in the start -> all programs, but I never use that before. (The PC is in the lab only for one course in my university, U of Mich.) I'll try your method next time when I go to the lab class, maybe next Monday. But I'm not sure whether I have the privilege to uninstall and install the Matlab on that PC. So I'll try solution 2 first. 🙂

Thanks a lot. 

0 Kudos
Message 3 of 5
(4,318 Views)
Why don't you try giving MathScript a whirl? For most scripts it can work just as well as Matlab. Pro: It's built into LabVIEW. Smiley Wink
0 Kudos
Message 4 of 5
(4,315 Views)

Ooh,  because I want to use the image acquisition toolbox in matlab.

Mathscript could only be used as math formula form.

Nevertheless, thank you very much. 

0 Kudos
Message 5 of 5
(4,279 Views)