Matlab/Simulink DLLs in CANape 12.0 – CANape RT-Target (DLL)
Measure and calibrate your model within CANape
Dipl.- Ing. Andreas Patzer
Dipl.- Ing. (FH) Gernot König
B. Eng. Felix Reeb
© 2009 . Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.
V 2.50
2009-09-10
Agenda
> Version / Software Information
Installation of CANape Realtime Target
Configuration of Matlab
Create a Simulink Model
Create a Simulink DLL from a Simulink Model
Defining Signals and Parameters
Integrate Simulink DLL into CANape
Model Explorer
Use Case 1: Simulink DLL during Online Measurement
Use Case 2: Simulink DLL as an Offline Analyzing Tool
Use Case 3: Bypassing with XCP
Use Case 4: Generate CAN Messages with Simulink DLL
Use Case 5: Image Processing
Additional Features
© 2009 . Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.
Slide: 2
3
5
7
9
18
27
38
52
69
79
81
90
94
96
Version / Software Information
Matlab/Simulink Target for CANape supports
Matlab/Simulink Version 7.0 (R14) to 8.1 (R2013a) (32Bit Versions &
64Bit Versions)
Real-Time Workshop
Microsoft C++ Compiler 6.0, 7.1 (Visual Studio 2003), 8.0 (Visual
Studio 2005), Visual Studio 2005 Express Edition, Microsoft VC++ 2008
Express Edition (starting with R2008b), Microsoft Windows SDK 7.1
(starting with R2012a)
Microsoft C++ Compiler 8.0 needs at least Matlab Simulink 7.2
(R2006a)
The current CANape Realtime Target 9.0.0 or above is necessary.
To use Simulink DLLs CANape 5.0 or above is necessary (CANape 9.0 is
recommended).
LLC-win32 compiler which comes with Matlab is not supported!
Open Watcom compiler is not supported!
This documentation is based on Matlab/Simulink 8.1 (R2013a) CANape 11.4
and CANape Realtime Target 11.4.0
© 2009 . Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.
Slide: 3
Agenda
Version / Software Information
> Installation of CANape Realtime Target
Configuration of Matlab
Create a Simulink Model
Create a Simulink DLL from a Simulink Model
Defining Signals and Parameters
Integrate Simulink DLL into CANape
Model Explorer
Use Case 1: Simulink DLL during Online Measurement
Use Case 2: Simulink DLL as an Offline Analyzing Tool
Use Case 3: Bypassing with XCP
Use Case 4: Generate CAN Messages with Simulink DLL
Use Case 5: Image Processing
Additional Features
© 2009 . Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.
Slide: 4
3
5
7
9
18
27
38
52
69
79
81
90
94
96
Installation of CANape Realtime Target
Install the CANape Real-
Time Target (DLL) for the
Matlab/Simulink Real Time
Workshop.
The CANape Real-Time
Target is included in the
CANape MATLAB
Integration Package that
comes with CANape.
Please find further
information in
Readme.htm which will be
displayed after the
installation.
© 2009 . Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.
Slide: 5
Agenda
Version / Software Information
Installation of CANape Realtime Target
> Configuration of Matlab
Create a Simulink Model
Create a Simulink DLL from a Simulink Model
Defining Signals and Parameters
Integrate Simulink DLL into CANape
Model Explorer
Use Case 1: Simulink DLL during Online Measurement
Use Case 2: Simulink DLL as an Offline Analyzing Tool
Use Case 3: Bypassing with XCP
Use Case 4: Generate CAN Messages with Simulink DLL
Use Case 5: Image Processing
Additional Features
© 2009 . Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.
Slide: 6
3
5
7
9
18
27
38
52
69
79
81
90
94
96
Configuration of Matlab
Choose your preferred compiler in Matlab by using the command:
>> mex –setup
Answer the question:
Would you like mex to locate installed compilers [y]/n?
with "yes" and make your decision
The Matlab search path
will be set automatically.
If your model couldn't
be created be sure that
the following entries are
on top of the list
© 2009 . Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.
Slide: 7
Agenda
Version / Software Information
Installation of CANape Realtime Target
Configuration of Matlab
> Create a Simulink Model
Create a Simulink DLL from a Simulink Model
Defining Signals and Parameters
Integrate Simulink DLL into CANape
Model Explorer
Use Case 1: Simulink DLL during Online Measurement
Use Case 2: Simulink DLL as an Offline Analyzing Tool
Use Case 3: Bypassing with XCP
Use Case 4: Generate CAN Messages with Simulink DLL
Use Case 5: Image Processing
Additional Features
© 2009 . Vector Informatik GmbH. All rights reserved. Any distribution or copying is subject to prior written approval by Vector.
Slide: 8
3
5
7
9
18
27
38
52
69
79
81
90
94
96