Is there any way to findout the Block Name,Subsystem Name,Signal name ,Parameter Name for all simulink blocks present in Model.

83 views (last 30 days)
I want to find out all the Signal Name and Parameter Name present inside different simulink blocks.I don't want to restrict to only set of some particular block by accessing those block.If the Model is given i just want to access all the signal name,Parameter Name ,Blocks Name,Subsystem name throughout the model. Is there anyway to get full model signal,parameter,Block,Subsystems name information or any algorithm to find it.

Answers (1)

jkorte_1000
jkorte_1000 on 28 May 2015
Edited: jkorte_1000 on 28 May 2015
Hi,
there are several ways to solve your problem. You can use the function 'find_system' to get a handle to every possible component of a simulink model.
H = find_system('Modelname','FindAll','On','Name','Blockname')
get(H)
The example code returns the handles to all blocks with the Name: Blockname. There are more arguments, witch allow you to specify your search. Just serach for 'find_system' in the MATLAB help. The get function gives you all block parameters as cell array.
If you have the handle to one block in the model you can navigate through the model, cause every block knows his connections to other blocks. You can use the line or port handles to do this.
Another way th get the model handle is the get_param function
H=get_param('Modellname','Handle')
You can use the get_param function to get every parameter of a simulink component.
I hope this helps you.
  2 Comments
gvreddy
gvreddy on 28 May 2015
Edited: gvreddy on 28 May 2015
I am using find_system(bdroot,'Variants','AllVariants'). It gives all blocks(inport, outports and subsystem, other blocks names) in model but I want parameters details. For example, I have gain block with gain Kp. Now I would like to list all parameters in model. How Can I do that?
jkorte_1000
jkorte_1000 on 29 May 2015
I know no other way than parsing all blocks in the model. So first you have to get all block handles and than read the interesting parameter of each block depending on the block type. This is necessary, because each block type has a different set of parameters. For example, knows a gain block as parameter only its gain, a saturation block knows one parameter more, its upper and lower limits. So if you want to list all the parameters of a modell you need to parse all blocks and write the intresting parameters into a list.

Sign in to comment.

Categories

Find more on Modeling 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!