How can we use find_system to get a block's SID

20 visualizaciones (últimos 30 días)
P Lepage
P Lepage el 28 de Sept. de 2020
Comentada: P Lepage el 1 de Oct. de 2020
In this page of the Matalb's documentation, it is said not to use the Simulink.ID.getSID() command and use find_system instead.
I have trouble understanding how to use find_system in order to replace this command.
I would also like to know why using Simulink.ID.getSID() is not recommanded.
Regards,
P Lepage.

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 29 de Sept. de 2020
It is true that find_system() is not the real replacement. If full block path is used in Simulink.ID.getSID() to get SID, then the replacement should be get_param(FullBlockPath, 'SID'). find_system might be used to find the block first.
Looking at the warning message in document for Simulink.ID.getSID, Simulink.ID.getHandle and Simulink.ID.hilite, I assume Mathworks is phasing out the Simulink.ID sub-class.
  5 comentarios
Fangjun Jiang
Fangjun Jiang el 29 de Sept. de 2020
When would the SID path (ModelName:SID) be used? If I know the SID number, I would do find_system(Model,'SID',###).
P Lepage
P Lepage el 1 de Oct. de 2020
They are stored in a map to have a reference that does not depend on block's name. This map is then used to hilite_system the block it contains through callbacks and generated html documents.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Simulink Functions en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by