To create the target equipment, the S-function Builder block needs access to its source files and the .mex file.
It seems that the source files and the .mex file
MUST be in the same directory on the Matlab path.
Is it possible to distribute the .mex file and other source files
through several directories
and still be able to create the target equipment?
Configuration:
- Minseg hardware (actually modified Arduino Mega 2560)
- Laptop with OS X (10.11)
- Xcode 6.xx (compiler supported by Mathworks)
- Mathworks Matlab / Simulink (r2015b)
- Mathworks Arduino Support Package (see command
targetinstaller) - Mathworks Minseg driver library (S-functions library based on C and C ++ code.)
- Both libraries are on the matlab path
- The compiler is configured for the C ++ language (see command
mex)
- Minimum Working Example ( MWE ):
- Simulink model correctly configured for use with the Arduino Mega 6050
- Contains MPU-6050 S-function block from the driver library connected to the scope.
MWE:
Create a model for the target equipment :
If the .meximac64 file and S-function source code files
are placed in the same directory on the Matlab path,
the model is built on the target equipment and works fine.