In order to protect the confidentiality of a Simulink model, the source generated can be compiled within MATLAB. All .c files will be compiled within a static library model.a.
Set environment variable to HYPERSIM installed directory (only for Windows)
Set environment variablesetenv('HYPERSIM_DIR','C:\OPAL-RT\HYPERSIM\hypersim_%version%')
- On the Simulink code option just check “Generate makefile” and uncheck “Generate code only”.
- Then process build code clicking on “Build”.
If the code generated will be run on a different architecture from the MATLAB’s one. For instance the model code is generated within MATLAB on Windows. Then it will be run on Linux real time architecture.
The code has to be compiled on the same architecture of the simulation server. - On the Simulink code option just check “Generate makefile” and then click “Generate Code”.
- Send the code generated to the simulation server.
Use the model.mk to compile the source on the simulation server. On a terminal enter the following command:
Compile the source on the simulation servergmake –f model.mk
- Send the code compiled to any third party protecting the confidentiality of the model.
- With the code compiled, the third party can process Step 3: Importing to HYPERSIM to run the model.