SimHydraulics (Simscape) automatic block connection

Hello, I'm using simscape and simhydraulics and i desperately need to connect simHydraulics (and some SimScape) components automatically, i.e. like add_line() for simulink blocks. I know that there are some comments that it is not supported for simscape, or , like in here: http://blogs.mathworks.com/seth/2010/01/21/building-models-with-matlab-code/ But maybe something changed since that.

1 件のコメント

Florian Knorn
Florian Knorn 2012 年 7 月 13 日
Did you ever manage in the end? If yes, how? Cheers!

サインインしてコメントする。

 採用された回答

Arnaud Miege
Arnaud Miege 2011 年 3 月 7 日

2 投票

That's still the case, add_line is still undocumented and therefore, unsupported. However, if you look at the documentation for port_label, it's not difficult to infer what the syntax is for using add_line with physical ports. I have used it myself successfully, but it does mean that this syntax may change in the future (since it's undocumented).

3 件のコメント

Tomas Iesmantas
Tomas Iesmantas 2011 年 3 月 7 日
Could you please write some examples? because maybe I'm just doing it in the wrong way: e.g. I create mask for hydraulic pipeline, then I specify for that mask: port_label('Input', 1,'A'), port_label('Output', 1,'B'). But Matlab doesn't like this and says "Warning: Port number 2 specified in 'port_label' exceeds the number of output ports of 'pirmas1/Subsystem'".
P.S. thanks for your advises.
Arnaud Miege
Arnaud Miege 2011 年 3 月 7 日
In the documentation for port_label, it states to use lconn and rconn for the physical modelling connection ports. Input and Output are for Simulink signals, not physical connections.
Tomas Iesmantas
Tomas Iesmantas 2011 年 3 月 7 日
Maybe I did something wrong (Obviously I did), but still no result. Coul you privide some example (that wold perfect), something like that:
add_block('sh_lib/Pipelines/Hydraulic Pipeline','pirmas1/Hydraulic Pipeline');
add_block('sh_lib/Pipelines/Hydraulic Pipeline','pirmas1/Hydraulic Pipeline1');
add_line('pirmas1','Hydraulic Pipeline/2','Hydraulic Pipeline1/1');

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by