Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Simulink line parameter

331 views
Skip to first unread message

Madincea Vasile

unread,
Dec 15, 2006, 8:13:52 AM12/15/06
to
I read through all the documentation, looking for what parameters
does "line" have. And I haven't found anything.

one of the parameter is Name, but I can't figure out the others.

my code is:

hLine = add_line... : this is the handle for the line
set_param(hLine,"name","...

Can anyone help me?

Thanks,

Vasi

Fangjun Jiang

unread,
Dec 15, 2006, 10:26:38 AM12/15/06
to
If you have the handle of the line, it's really easy.

type get(hLine) in command window to see the properties.

use set(hLine,...) to set values. set_param(hLine,...) works too.

Titus Edelhofer

unread,
Dec 15, 2006, 11:01:23 AM12/15/06
to
Hi Vasile,

how are things going? Haven't heard from each other for a while ;-)

params = get_param(hLine,'ObjectParameters')

shows you the possible parameter names of the line (works for blocks and
models as well!).

Titus

"Madincea Vasile" <vasile....@siemens.com> schrieb im Newsbeitrag
news:ef48b...@webcrossing.raydaftYaTP...

Madincea Vasile

unread,
Dec 16, 2006, 2:46:17 PM12/16/06
to
Thanks...it works
Titus: did we do a workshop togheter a year ago?

Madincea Vasile

unread,
Dec 18, 2006, 3:24:06 AM12/18/06
to
If for example, I have a subsystem with I/O.
How can I get a handle to the lines going and coming from the
subsystem.

Thanks again for the previous help.

Vasi

Titus Edelhofer

unread,
Dec 18, 2006, 9:53:50 AM12/18/06
to
Hi Vasi,
yes, that was me visiting you last year...

Titus

"Madincea Vasile" <vasile....@siemens.com> schrieb im Newsbeitrag

news:ef48...@webcrossing.raydaftYaTP...

Graham Fletcher

unread,
Dec 18, 2006, 10:55:04 AM12/18/06
to
Hi Vasile,

If you have a block, named 'BlockA', you can get handles to the
signal lines that connect to the block:

BlkName = 'BlockA';
Ports = get_param(BlkName, 'PortHandles');
PortHandle = Ports.Inports(1);
LineHandle = get_param(PortHandle, 'Line');

and you could then, for example, find which block(s) that line is
sourced from (for a signal line going to an inport on our theoretical
'BlockA'):

SrcBlkHandle = get_param(LineHandle, SrcBlockHandle);
get_param(SrcBlkHandle, 'Name');

If you're not actually interested in the line, just in what it's
connected to at the other end, you have another method:

BlkName = 'BlockA';
PortConns = get_param(BlkName, 'PortConnectivity');

PortConns is then an array containing fields which give
Source/Destination block handles & port numbers.

HTH,
Graham.

<snip>

Madincea Vasile

unread,
Dec 19, 2006, 1:54:49 AM12/19/06
to
Yes, it works perfect.
Thanks a lot for the help.
0 new messages