2
votes

I have a Simulink model "mod" with a Subsystem "link" in it, which is actually an active (i.e. "resolved") library link. Inside this linked Subsystem there is a Stateflow Chart "chart".

In Simulink I can search for the Stateflow Chart like this:

find_system('mod', 'FollowLinks', 'on', 'Name', 'chart')

But when I have the model as object "modObj", I can also use its "find" method:

modObj.find('Name', 'chart')

Unfortunately the "find" method does not follow resolved library links by default. Also the documentation does not describe a parameter like "FollowLinks" for "find_system". I already tried using "FollowLinks" and "-followlinks" but without success. Also searches on the net gave no result.

Is there an undocumented parameter for this functionality?

I know that I can use the "find_system" function for the above example. But in fact I am searching for Stateflow objects inside models, which are only found by the "find" method.

1

1 Answers

1
votes

It seems that it is not possible to navigate through linked Stateflow objects. I have now worked around this by implementing a method which detects linked Stateflow charts (by using the "ReferenceBlock" property of the Simulink handle), ensuring the linked library is loaded and returing the library's object. Then I am able to work on the library instead of the current model (although it might be locked, but searching and property extraction is always possible).