MATLAB Answers

Code Generation Visual Studio 2017 for CANoe-Modell .dll

35 ビュー (過去 30 日間)
Ali Zeitoun
Ali Zeitoun 2019 年 3 月 16 日
編集済み: Stefanie Schwarz 2020 年 5 月 27 日
English-version:
Hello, For my bachelor thesis I'm currently trying to integrate a Simulink model into CANoe.
I'm using Visual Studio Community 2017 as a compiler, Windows SDK 7.1, and Matlab 2018b.
>> mex -setup MEX configured to use Microsoft Visual C ++ 2017 (C) for C language compilation.
>> installedCompilers.Location
ans = 'C: \ ProgramData \ MATLAB \ SupportPackages \ R2018b \ 3P.instrset \ mingw_w64.instrset'
ans = 'C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Community \'
The model works in offline mode and synchronized mode. For HiL-Mode you need to generate a DLL file. However, many errors occur during code generation:
Checking block usage. ### Generate CANoe Model Viewer information for model: sin_ ### Generate model description file: sin_.ini 0 file(s) in 2.9 sec generated. ### Starting Real-Time Workshop build procedure for model: sin_ ### Generating code and artifacts to 'Model specific' folder structure
Code Generation
Elapsed: 28 sec
### Generating code into build folder: C:\Users\Ali Zeitoun\Desktop\Sine\sin__cn_rtw
### Invoking Target Language Compiler on sin_.rtw
### Using System Target File: C:\Program Files\MATLAB\R2018b\rtw\c\canoe\cn.tlc
### Loading TLC function libraries ### Initial pass through model to cache user defined code .
### Caching model source code
### Generating TLC interface API.
### Writing source file sin__capi.c ...... // Hier war die Generierung erfolgreich
TLC code generation complete.
### Processing Template Makefile: C:\Program Files\MATLAB\R2018b\rtw\c\canoe\cn_msdll.tmf
### sin_.mk which is generated from C:\Program Files\MATLAB\R2018b\rtw\c\canoe\cn_msdll.tmf is up to date
### Building sin_: .\\sin_.bat
C:\Users\Ali Zeitoun\Desktop\Sine\sin__cn_rtw>set VSCMD_START_DIR=C:\Users\Ali Zeitoun\Desktop\Sine\sin__cn_rtw C:\Users\Ali Zeitoun\Desktop\Sine\sin__cn_rtw>set
WINSDK_71A=C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\
C:\Users\Ali Zeitoun\Desktop\Sine\sin__cn_rtw>cd .
C:\Users\Ali Zeitoun\Desktop\Sine\sin__cn_rtw>call "set MINGW_ROOT_PATH=C:\ProgramData\MATLAB\SupportPackages\R2018b\3P.instrset\mingw_w64.instrset" x86
Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch. \\ error
C:\Users\Ali Zeitoun\Desktop\Sine\sin__cn_rtw>nmake -f sin_.mk MAT_FILE=1 GENERATE_MODEL_DESCRIPTION=1 DEBUG_BUILD=0 COMBINE_OUTPUT_UPDATE_FCNS=0 INCLUDE_MDL_TERMINATE_FCN=1 MULTI_INSTANCE_CODE=0
ISPROTECTINGMODEL=NOTPROTECTING TARGET_ARCH="x86" XCP_MAX_MSG_LENGTH=-1 ANALYSIS_MODEL=0 HAS_CAPL_CALL=0 BUILD_ERT=0
Der Befehl "nmake" ist entweder falsch geschrieben oder konnte nicht gefunden werden. \\ error
C:\Users\Ali Zeitoun\Desktop\Sine\sin__cn_rtw>echo The make command returned an error of 9009
The make command returned an error of 9009 \\hier der 3.Fehler
C:\Users\Ali Zeitoun\Desktop\Sine\sin__cn_rtw>An_error_occurred_during_the_call_to_make Der Befehl "An_error_occurred_during_the_call_to_make" ist entweder falsch geschrieben oder konnte nicht gefunden werden.
Error(s) encountered while building "sin_" \\ here are also errors to find..
Could jmd please help me?
Ali
Deutsch-Version
Hallo,
für meine Bachelorarbeit versuche ich im Moment, ein Simulink-Modell in CANoe zu integrieren.
Ich verwende Visual-Studio Community 2017 als Compiler, Windows SDK 7.1, und Matlab 2018b.
>> mex -setup MEX configured to use 'Microsoft Visual C++ 2017 (C)' for C language compilation.
>> installedCompilers.Location
ans = 'C:\ProgramData\MATLAB\SupportPackages\R2018b\3P.instrset\mingw_w64.instrset'
ans = 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\'
Das Modell funktioniert in Offline-Mode und synchronized-Mode. Für HiL-Mode braucht man eine DLL Datei zu generieren.
Jedoch bei der Code-Generierung tauchen viele Fehler auf (siehe den Code oben)
Könnte mir jmd bitte helfen?
Viele Grüße
Ali

  0 件のコメント

サインインしてコメントする。

回答 (1 件)

Stefanie Schwarz
Stefanie Schwarz 2020 年 5 月 27 日
編集済み: Stefanie Schwarz 2020 年 5 月 27 日
In general, please contact Vector for questions regarding their cn.tlc target:
As far as we know, cn.tlc uses C++ language so please make sure to:
1) Run the command
>> mex -setup c++
in MATLAB to select the supported Visual Studio compiler.
2) Select C++ as Language in the model settings under Configuration Parameters > Code Generation.

  0 件のコメント

サインインしてコメントする。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by