MATLAB: Requirements command ‘rmi’ doesn’t return requirements linked to library blocks

Simulink Check

I have requirements linked to a library block. When I use the following command on the block in my model, it doesn't return the details.
 
>> rmi('get', gcbh)
But when I disable the library links, it returns the details. Is this the expected behavior? How do I get the details without breaking links?

Best Answer

 The 'rmi' command is expected to return the requirements associated with that block but not the requirements associated with a library reference block. This is the reason for this behavior.
To get the requirements linked to a library block, you can adapt your MATLAB code similar to the following:
 
libBlk = get_param(gcbh,'ReferenceBlock');
if isempty(libBlk)
out = rmi('get', gcbh);
else
out = rmi('get', libBlk);
end