ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My solution to MATLAB script error 1047 and error 1050

MATLAB: Version R2007b
Labview: Version 8.5 and Version 8.2.1
OS: Windows Vista SP1
 
Symptoms:  VI's containing a MATLAB script node either did not load, took a very long time to load, or produced error 1047 or 1050.
 
Explanation:  Matlab had an error in running as an automation (COM) object and would not load.  This is testable by going to the bin directory of matlab (in my case C:\Program Files\MATLAB\R2007b\bin) in a command prompt and typing "matlab -automation".  In my case MATLAB did not appear, but typing "matlab -automation -nojvm" did enable MATLAB to appear.  Logic dictates this was a JAVA virtual machine problem, looking in the C:\Users\<my user name>\AppData\Local\Temp directory reveals the JAVA log files with a name of the form java.log.<some number>.  In my case, the contents looked like this:
 
Error occurred during initialization of VM
Could not reserve enough space for object heap
Stack Trace:
  [0] jmi.dll:void __stdcall mwJavaAbort(void)(0x78f95578 "Could not reserve enough space f..", 0, 0x78dd0000, 0x03fe3130 "øNúx") + 21 bytes
------------------------------------------------------------------------
        Fatal Java Exception detected at Thu Apr 17 20:17:48 2008
------------------------------------------------------------------------
Configuration:
  MATLAB Version:   7.5.0.342 (R2007b)
  Operating System: Microsoft Windows Vista
  Window System:    Version 6.0 (Build 6001: Service Pack 1)
  Processor ID:     x86 Family 6 Model 15 Stepping 6, GenuineIntel
  Virtual Machine:  Java is not enabled
  Default Charset:  windows-1252
Java is not enabled
 
Solution:  Following this procedure (http://www.campus.uniroma1.it/Licenze/Installazioni/MatLab75/fac/398525.htm) and in particular setting the environment variable "MATLAB_RESERVE_LO=0" fixed the problem.  Now when I type "matlab -automation", a matlab window pops up, and Labview is able to run matlab script nodes once more.
 
I spent a day of my life on this and for the sake of humanity wanted to share the solution - hope it helps!


Message Edited by Kevin Parkin on 04-17-2008 10:54 PM
Message 1 of 5
(7,918 Views)
Thanx for sharing the info.I suppose i didnt explore it that well.
0 Kudos
Message 2 of 5
(7,508 Views)
Hey and congratulations on becoming a proven member with a single post. Wow coming into the forum with a B-A-N-G!!!!!!!!!!!
0 Kudos
Message 3 of 5
(7,507 Views)

I have the same problem (error 1047), but i can't load the link, you had written (http://www.campus.uniroma1.it/Licenze/Installazioni/MatLab75/fac/398525.htm)

So pls help!

Kolos 

0 Kudos
Message 4 of 5
(6,627 Views)

Oh, i found the solution: http://digital.ni.com/public.nsf/allkb/4475BC3CEB062C9586256D750058F14B

Just download a new dll file... 

0 Kudos
Message 5 of 5
(6,625 Views)