What does the error "(UNIQUE constraint failed: BLOCKDETAI​LS.BLOCK_P​ATH)" mean in Simulink?

조회 수: 21 (최근 30일)
When updating from MATLAB r2020a to version r2020b, r2021a, or r2021b, my custom S-Function now causes Simulink to issue an error message in the diagnostic viewer when it's loaded for the first time:
Database constraint violation in C:\Users\myPc\AppData\Local\Temp_mw_qi_20052_mw__mw_resources_mw_\qi_db\myPc_slblocks_master.db. (UNIQUE constraint failed: BLOCKDETAILS.BLOCK_PATH)
The Simulation still runs fine, and still generates correct results. I've been using the same exact s-function wrapper code for years, and I use it with two other DLLs with no error.
I can't seem to find any information out there that can steer me towards what this error means, or what sorts of things cause it. Google just tells me that its similar to a SQL database error, but none of the parts on my end use a SQL database, so I'm at a loss. But my customers notice, and wonder what's going on.
Has anyone seen this before?

답변 (1개)

Raghav Bansal
Raghav Bansal 2024년 3월 5일
Hi Drew,
It seems to me that the issue is with the "myPc_slblocks_master.db" file located in the path mentioned by you in the error message. As an initial troubleshooting, I would suggest you to follow the below steps:
  1. Exit MATLAB
  2. Locate and delete the slblocks_master.db, it can be found under the directory "C:\Users\username\AppData\Roaming\MathWorks\MATLAB\R2021b\__mw_resources_mw__\qi_db".
  3. Start MATLAB and Simulink. The aforementioned file should get regenerated when you try using the "quick insert" feature.
If the above doesnot help in resolving the issue, I would suggest you to perform a clean installation of MATLAB.
Thanks!

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by