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 variable
Code Block language cpp
...
...
setenv('HYPERSIM_DIR','C:\OPAL-RT\HYPERSIM\hypersim_%version%')
On the Simulink code option
...
, check “Generate makefile” and uncheck “Generate code only”.
Then process the build code by 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
...
must be compiled on the same architecture of the simulation server.
On the Simulink code option
...
, 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 server
...
(for OPAL-RT Linux)
Code Block language bash make –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.
...