How can I get block handle using SID param from codedescri​ptor.getDa​taInterfac​es output

6 views (last 30 days)
We have a custom target file for simulink coder where, we have a 'before make hook' to collect model data( like list of IO ports, signals and parameters) to create a metadata json file (this is needed as we cannot use CAPIs from generated binaries to query this info on a windows application that configures the system when they are built for different platforms).
We use codedescriptor.getDataInterfaces methods for getting model information.
The output of the above function, has a field called SID.
We are planning to use Simulink.ID.getHandle to get the block handle for these items to get more information than is available with the dataInterface eg: blockPath of a parameter
We noticed that the documentation recommends against usage of functions that use SID.
Are there plans to provide a replacement for SID in the future releases of MATLAB ?
Is there any alternate way of going from codeDescriptor's data interfaces to block handles ?
We tried using find_systems as recommended but it has some cons:
  1. We do not have access to all the info returned from codeDescriptors.
  2. No access to inherited values (eg data types)
1. We tried using model([],[],[],'compile') command to get 'compiledDatatypes' but,
1. When the top level model has a protected model reference block, putting the model in compile mode throws error:
Detected recursive call to slbuild, which might indicate invalid simultaneous model builds.
If only one model build was in progress, and if you previously used dbquit while in the MATLAB debugger
or pressed Ctrl-C during the build process, please restart the model build.
2. We get this error only when called from hook methods. model([],[],[],'compile') works as expected on MATLAB console for such models.

Answers (0)

Categories

Find more on Simulink Coder in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!