09-22-2009 04:07 PM
I've asked the same question at the Simulink forums, but maybe someone here has the answer:
I'm trying to perform this process here:
http://zone.ni.com/devzone/cda/tut/p/id/3447
However, I get the following errors from the Simulink Real Time Workshop:
Error building Real-Time Workshop target for block diagram 'SensorCAN_sfcn'. MATLAB error message:
Error using ==> setup_for_visual>LocIssueMSDevError at 324
Invalid setting for environment variable MSDevDir or DevEnvDir.
The setting is: ''
You can verify the setting by checking for the existence of:
%DevEnvDir%\..\tools\vsvars32.bat (for Visual C/C++ 7.1)
%MSDevDir%\..\..\vc98\bin\vcvars32.bat (for Visual C/C++ 6.0)
%DevEnvDir%\..\tools\vsvars32.bat (for Visual C/C++ 8.0)
I do not use Visual C, what little programming I do has been done in Borland Builder or with command line gcc. Is there any way to make simulink look for a different dev environment? Or does this process require Visual C?
Solved! Go to Solution.
09-23-2009 05:06 AM
Hey,
It depends on what version of SIT you are using.
With SIT 5.0 and later you can use a free compiler like described here:
http://digital.ni.com/public.nsf/allkb/AAD15283A1F051A1862574F000744DBD?OpenDocument
With earlier versions you need VS 2006.
Hope this helps,
Christian
09-24-2009 08:28 AM
Thanks, I've got SIT 5.0 installled, but it turns out we have a site license for VS 2008, so I now have that as well. I've got a new problem though, and although I think it's related to Simulink, these forums seems a little more responsive than that Matlab forums. So....
I’m working with someone else's s-code, and I haven't used Simulink in the past. As I said in my original post, I am attempting to use SIT to turn the s-code into a dll for use in a LabView RT application. I opened the mdl file in Simulink, and I’m now trying to build the LabView dll in the Simulink Real Time Workshop. The target file is nidll.tlc and Matlab starts the SIT when launched, so it appears the tools are aware of each other. However, when I attempt to build the dll, I get the following error:
fatal error C1083: Cannot open include file: 'rtlibsrc.h': No such file or directory
I’m using the following: Matlab 2008b, SIT 5.0, and MS Visual Studio 2008, so the libraries and includes should be fairly up to date. What I don't get is that the files that are calling for this include are auto-generated by Simulink, so I don't know why it's not finding the rtlibsrc.h. Still, I found that in the RTW subdirectory, and copied it into my local directory. This gives me a different error:
### Linking ...
C:\PROGRA~1\MATLAB\R2008b\sys\perl\win32\bin\perl C:\PROGRA~1\MATLAB\R2008b\rtw\c\tools\mkvc_lnk.pl SensorCAN_sfcn.lnk SensorCAN_sfcn.obj rtGetInf.obj rtGetNaN.obj rt_logging.obj rt_matrx.obj rt_nonfinite.obj rt_printf.obj rt_sfcn_helper.obj nidll_main.obj rt_sim.obj SensorCAN_sfcn.res SensorCAN0_sf.obj
link /RELEASE /INCREMENTAL:NO /NOLOGO -entry:_DllMainCRTStartup@12 -dll /NODEFAULTLIB:MSVCRT LIBCMT.LIB kernel32.lib ws2_32.lib mswsock.lib advapi32.lib @SensorCAN_sfcn.lnk /dll -out:SensorCAN_sfcn.dll
Creating library SensorCAN_sfcn.lib and object SensorCAN_sfcn.exp
SensorCAN0_sf.obj : error LNK2019: unresolved external symbol _rt_Lookup referenced in function _mdlOutputs
Again, self-generated code, now with unresolved external symbols? I'm assuming that I'm linking the wrong version of a dll or obj that contains mdlOutputs, which appears to be something from Matlab. Can anyone point me in the correct direction? Missing headers and incorrect libraries lead me to believe that I've got a search path issue somewhere, but the Matlab/Simulink/LabView/Visual Studio are all fresh default installs.
09-28-2009 10:53 AM
09-29-2009 09:41 AM
I'm using the following software versions (listed by order of installation):
MS Visual Studio 9.0.21022.8 (R2008)
MATLAB 7.7 (R2008b)
Simulink 7.2 (R2008b)
Real-Time Workshop 7.2 (R2008b)
LabView 8.6
SIT 5.0
09-29-2009 10:07 AM
09-30-2009 03:03 PM
10-01-2009 10:28 AM
I found that tutorial, and posted a new topic regarding that because I didn't think this subject title was an accurate representation of the question. You'll find that post here:
http://forums.ni.com/ni/board/message?board.id=170&message.id=444783#M444783
10-01-2009 10:32 AM
10-02-2009 05:38 PM