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!