Need technical support?
Debugging CarMaker for Simulink using Visual Studio
Question
How can I debug my C-code additions in a CarMaker for Simulink (CM4SL) environment?
Solution
This is possible by using the CarMaker for Simulink.sln file in the /src_cm4sl folder of the CM Project folder. This is the solution file that can be loaded onto MS Visual Studio and has references to the Visual Studio .vcxproj Project files.
Note: The *.sln and *.vcxproj files are only available, if the option 'Sources/Build Environment' is activated when creating or updating the project.
To be able to perform debugging using MS Visual Studio in CM4SL environment, follow the steps below after code integration:
- In the Visual Studio Configuration Manager, set the Active solution configuration → Debug
- Build the “CarMaker for Simulink” project:
- This generates the "libcarmaker4sl.mexw64″ and “libcarmaker4sl.pdb” files under the /src_cm4sl folder
- Now open the relevant Matlab version, run cmenv.m script and start the .mdl/.slx file in Simulink, then open the 'CM for Simulink' GUI
- From the Visual Studio window -> Debug menu, select 'Attach to Process'
- In the Attach to Process dialog box, select the MATLAB process and click Attach.
- Now you can set breakpoints within Visual Studio as usual..
- Click on start Debugging in Visual Studio
- TestRuns can now be started as usual in CM4SL GUI.
Refer Link for help on Debugging CarMaker (Standalone) with Visual Studio.
Need technical support?
- Date: 01.03.2021
- Product: CarMaker
- Version: 12.0
- Component: C-Code Interface
- Language: English
Tags
DebuggingVisual Studio
MSVC
CM4SL