LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help: Failed to Converting a model into a model DLL

My system:
Win XP
LabVIEW 8.0
SIT 3.0.1
Matlab 7.0.1 R14
MS Visual Studio 2005
 
Hope any one can help out here! Thanks!
 
I want to convert a .mdl file into DLL then I can use in LabVIEW for certain stand alone application. However, I always got the following two errors after I clicked 'Build':
 
Build Error:
 
Error using ==> RTW.makertw.make_rt
Error using ==> rtw\private\issue_inv_comp_env_val_error
Invalid setting for environment variable MSDevDir or DevEnvDir.
The setting is: '[c:\program files\microsoft visual studio 8] \common7\ide'
You can verify the setting by checking for the existence of:
  %MSDevDir%\..\vc\bin\vcvars32.bat          (for Visual C/C++ 5.0)
  %MSDevDir%\..\..\vc98\bin\vcvars32.bat     (for Visual C/C++ 6.0)
  %DevEnvDir%\..\tools\vsvars32.bat          (for Visual C/C++ 7.0)
You must define MSDevDir or DevEnvDir to be:
  set %MSDevDir%=<VisualRoot>\sharedide      (for Visual C/C++ 5.0)
  set %MSDevDir%=<VisualRoot>\common\msdev98 (for Visual C/C++ 6.0)
  set %DevEnvDir%=<VisualRoot>\common7\ide   (for Visual C/C++ 7.0)
This error may be due to an invalid preference file:
  C:\Documents and Settings\Owner\Application Data\MathWorks\MATLAB\R14\mexopts.bat
Please run "mex -setup" at the MATLAB prompt to correct
 
 
Model Error:
 
Error building Real-Time Workshop target for block diagram 'SinWave'. MATLAB error message:
Error using ==> slbuild
Error using ==> RTW.makertw.make_rtw
Error using ==> rtw\private\issue_inv_comp_env_val_error
Invalid setting for environment variable MSDevDir or DevEnvDir.
The setting is: '[c:\program files\microsoft visual studio 8] \common7\ide'
You can verify the setting by checking for the existence of:
  %MSDevDir%\..\vc\bin\vcvars32.bat          (for Visual C/C++ 5.0)
  %MSDevDir%\..\..\vc98\bin\vcvars32.bat     (for Visual C/C++ 6.0)
  %DevEnvDir%\..\tools\vsvars32.bat          (for Visual C/C++ 7.0)
You must define MSDevDir or DevEnvDir to be:
  set %MSDevDir%=<VisualRoot>\sharedide      (for Visual C/C++ 5.0)
  set %MSDevDir%=<VisualRoot>\common\msdev98 (for Visual C/C++ 6.0)
  set %DevEnvDir%=<VisualRoot>\common7\ide   (for Visual C/C++ 7.0)
This error may be due to an invalid preference file:
  C:\Documents and Settings\Owner\Application Data\MathWorks\MATLAB\R14\mexopts.bat
Please run "mex -setup" at the MATLAB prompt to correct
0 Kudos
Message 1 of 4
(3,253 Views)
Hello,

SIT and LabVIEW Real-Time do not currently support Visual Studio 2005 (also called Visual Studio 8.0). Also, The MathWorks, Inc. MATLAB® application software 7.0.1 does not support Visual Studio 2005; according to their documentation, support for VS 2005 was added in Matlab version 7.2 (also called R2006a). That is the cause of the errors you are seeing.

If you switch to Visual Studio 2003, then you will be able to build and run model DLLs. I am sorry for any inconvenience this causes. Once you've got Visual Studio 2003 installed, then you need to indicate that you want it to be used. As the error message says, "Please run "mex -setup" at the MATLAB prompt to correct". Running this will give you a list of the installed compilers and you will be able to choose Visual Studio 2003, and then you will be able to run your builds without this issue.

Also, just a reminder that to build a DLL which will run on a LabVIEW Real-Time target you must choose "nidll.tlc" as the build file, instead of the default (grt.tlc).

I hope this helps!
-Andrew
Message 2 of 4
(3,247 Views)
Thanks, I will try that and let you know the results. Smiley Very Happy
0 Kudos
Message 3 of 4
(3,241 Views)

Hello,

I got the same problem even though I use  Visual Studio .net 2003 and Matlab R2006b (also R2007a does not work).

When I run the mex -setup the MS Visual Studio compiler is not listed:

Would you like mex to locate installed compilers [y]/n? y
 
Select a compiler:
[1] Lcc C version 2.4.1 in C:\PROGRA~1\MATLAB\R2006b\sys\lcc
 
[0] None
 
Compiler:

You quoted that I have to indicate that I want the compiler to be used. How do I do this?

Regards

Jens

 

 

0 Kudos
Message 4 of 4
(2,913 Views)