How do I remove the warning "SID could not be resolved in ModelName"?

8 views (last 30 days)
I use Simulink and the Requirements Toolbox. My model runs as expected, but the warning below appears after opening the model or after loading it in the background. Updating the model with Ctrl-D or running the model removes the warning. The warning is:
Warning: SID <SIDNum> could not be resolved in <ModelName>
where SIDNum consists of colons and numbers in the form ":number:number".
If I use "Simulink.ID.getSID" to get all of the SIDs in the model, the one mentioned in the error does not appear.
If I use "Simulink.ID.getHandle" to get the object with the SID mentioned in the warning, I get an error that the object does not exist. 
How do I resolve this warning?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 23 Nov 2023
Edited: MathWorks Support Team on 23 Nov 2023
The warning may be caused by a link in a requirement set with an unresolved source or destination. The warning should be harmless, although it does mean there is a requirement somewhere that is not used, or not tested. This could be one that is no longer relevant based on your model or requirement sets.
The best option is to create a script to look through the requirement set for a link with a source or destination matching the SID in the warning. This script below loads a requirement set, iterates over all of the links, and checks each source ID and destination ID against the SID from the warning. Try running this script for all of the link sets used with this model. 
You can add code next to the comments to print our additional information about the link that may help you find the link causing the issue.
linkset = slreq.load('<linkSetName>.slmx')
allLinks = linkset.getLinks();
for i = 1:numel(links)
if strcmp (links(i).source.id, "<SIDNum>")
​​​ links(i).source
links(i).destination​​​​
%add code to print out more info about link
end
if strcmp (links(i).destination.id, "<SIDNum>")
links(i).source
links(i).destination;
%add code to print out more info about link
end
end

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!