get Simulink block libinfo in find_system

4 visualizzazioni (ultimi 30 giorni)
The 'Library' and 'ReferenceBlock' info from 'libinfo' is very useful, but 'libinfo' does not return as many blocks as find_system. In the case I am working on, find_system returns about 500 more blocks than libinfo. However, none of the block properties appear to be 'Library' or 'ReferenceBlock'. Is there anyway to obtain this? I use get(get_param(handlesReturnedByFind_System, 'handle')) to get block parameters.
Thanks is advance

Risposta accettata

Fangjun Jiang
Fangjun Jiang il 30 Lug 2024
Modificato: Fangjun Jiang il 30 Lug 2024
'ReferenceBlock' is a block property. 'Library' is not. You are probably looking for 'LinkStatus'.
model='f14';
open_system(model)
b=find_system(model,'FindAll','on','type','block','LinkStatus','resolved')
get_param(b,'ReferenceBlock')
ans =
'simulink/Sources/Band-Limited
White Noise'
>> lib=libinfo(model)
lib =
struct with fields:
Block: 'f14/Dryden Wind↵Gust Models/Band-Limited↵White Noise'
Library: 'simulink'
ReferenceBlock: 'simulink/Sources/Band-Limited↵White Noise'
LinkStatus: 'resolved'
If you are asking, in the returned info of libinfo(), where does that 'Library' info come from?
then, it is the file name (or library name) of the library block specified in 'ReferenceBlock'.
>> bdroot(lib.ReferenceBlock)
ans =
'simulink'

Più risposte (0)

Categorie

Scopri di più su Programmatic Model Editing in Help Center e File Exchange

Prodotti


Release

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by