Issue with protected model and mask function
5 次查看(过去 30 天)
显示 更早的评论
Hi there,
I've a simulink model with a reference model (calling to a protected model) and a block linked to a library. The library block is simulating other block diagram within its mask. Well, something very strange is happening when updating the block diagram with this configuration
When the mask function is evaluated (calling the sim command) the **_msp.mexw64 file previously created for the protected model is automatically deleted. Therefore, the model update results in error with the following message
"Error in Model block 'call_lib_model/Model': The model reference simulation target for the referenced model 'ref_model' does not exist. One reason this can happen is that the top model has the 'Rebuild options' parameter set to 'Never' on the 'Model Referencing' pane of the Configuration Parameters dialog."
My guess is that when you simulate another block diagram while doing the update of another, the slprj folder contents corrupt somehow and, therefore, the process finds an error.
My objective is to tell Simulink to create and use another slprj folder for the second simulation. I've tried to do it using the Simulink.fileGenControl, but I've not managed to get this working.
I'm attaching a dummy folder with all files needed to reproduce the error.
Many thanks in advanced
0 个评论
回答(1 个)
Yash
2023-10-26
Hi Borja,
I understand that you are facing issues while referencing a protected model in Simulink. After conducting a simulation of the model using MATLAB R2017b, I was able to reproduce the error you mentioned. Despite following the provided instructions, I was unable to resolve the error.
However, I discovered that running the model in a more recent release (MATLAB R2023a) did not result in any errors. I recommend you to update MATLAB to the latest relase to resolve the issue.
Note that in order to achieve this, you need to export the "ref_model" to a protected model using the later release. Additionally, ensure that the necessary folders are added to the MATLAB path so that the model can locate the referenced model.
Hope this helps.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Model Protection 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!