set_param on block inside library
조회 수: 16 (최근 30일)
이전 댓글 표시
I am using the command:
find_system(....,'FollowLinks','on'....)
to find blocks in my system. I then am running
set_param(...'AttributesFormatString',...)
on the blocks that have been found to add some labels.
How do I use "set_param" to change parameters inside library links properly. I would imagine I need to disable the link, set the param, and then restore the link -or- open the referenced library for the block and edit the library directly.
Any suggestions/ideas on the best way to do this?
----------Update---------
Here is an example of my hierarchy:
mybench -> Subsystem_top -> subsystem_bot -> Constant
Subsystem_top is a library block from mylib_a/Subsystem Subsystem_bot is a library block from mylib_b/Subsystem
The find_system is returning the handle for the constant. I want to use set_param on the constant and update it's properties within the library mylib_b.
댓글 수: 0
답변 (2개)
Sreeram Mohan
2015년 5월 19일
Hi Aaron,
It purely depends on what is the final intention. For example : Case 1: If you make some changes to the link (that is the block used in the model) and want to propagate the change to all the instances of the block in all models you should do a propagate. In this case Just disable the link, make the set_param and then propagate the change to the library. Case 2: If you want to just locally modify the link and then do not want to keep the relationship with the library. Then you could break the link. If you do so then you permanently loose the relationship with the library. If this is the intention. You just need to break the link and then do set_param at the cost that you no longer have a connection with the library or any other instances and you are working on a stand alone copy or (broken link) .
Hope this helps,
--sreeram
Sreeram Mohan
2015년 5월 20일
Hi Aaron,
Please take a look at this link http://in.mathworks.com/help/simulink/ug/working-with-library-links.html
If you want to disable a link you would just call set_param(block, 'LinkStatus','inactive');
The table in the link that I have posted has all the values that can help with the library links.
Hope this helps !!
Sreeram
참고 항목
카테고리
Help Center 및 File Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!