Library dictionary corrupted on re-load

13 vues (au cours des 30 derniers jours)
David Miller
David Miller le 12 Août 2024
Réponse apportée : Himanshu le 13 Août 2024
Why might this be happening? I've put some interface definitions in a data dictionary in a separate library. I then have pulled in the library block into a Simulink model. When I do so, it populates the expected entries in the "From Libraries" section in the Model Explorer, but once I save and reload via "load_system" I get the following errors and no access to the relevant variables from the library data dictionary.
Warning: Unable to load graph or digraph object because it was corrupted.
> In Simulink.LibraryDictionary.helperLoadOnDiscLinkageInfoFile
In Simulink.LibraryDictionary.getInstanceOfDependencyInfo
In load_system>i_load_system (line 44)
In load_system (line 20)
Warning: Unable to load graph or digraph object because it was corrupted.
> In Simulink.LibraryDictionary.helperLoadOnDiscLinkageInfoFile
In Simulink.LibraryDictionary.getInstanceOfDependencyInfo
In load_system>i_load_system (line 44)
In load_system (line 20)
From that point on, it seems to be broken unless I clear the cache, and refresh the data dicitonary via:
Simulink.DataDictionary.resetLibraryLinks;
Simulink.DataDictionary.refresh('mymodel.slx');
set_param('mymodel', SimulationCommand='update')
I can get around it for now, by adding the resetting and refreshing to my preload, but I'm concerned that if the interface grows that will slow down the loading of my model.

Réponses (1)

Himanshu
Himanshu le 13 Août 2024
Hi David,
This was likely a bug in the MATLAB R2023a. I had also faced this issue, and was able to resolve it by upgrading to MATLAB R2023b. As you have already mentioned, a workaround for this is to the run the command:
Simulink.LibraryDictionary.resetLibraryLinks
the documentation for which can be found below:
https://www.mathworks.com/help/simulink/slref/simulink.librarydictionary.resetlibrarylinks.html

Catégories

En savoir plus sur Manage Design Data dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by