Discussion:
accessing simulink information from command prompt
(too old to reply)
devendra rai
2004-10-21 08:14:47 UTC
Permalink
Hi,

I have a simulink model. I wish to be able to select a block and be
able to backtrack to all the non-virtual blocks that drive it. I wish
to get this information in an m file ( or whatever file).

Is there any function to do this? Does matlab/simulink support this?

I shall be glad if somebody could help.

Thanks,

devnedra rai
riccardo
2004-10-21 09:52:02 UTC
Permalink
Post by devendra rai
Hi,
I have a simulink model. I wish to be able to select a block and be
able to backtrack to all the non-virtual blocks that drive it. I wish
to get this information in an m file ( or whatever file).
Is there any function to do this? Does matlab/simulink support
this?
I shall be glad if somebody could help.
Thanks,
devnedra rai
Hi,
1) search the documentation for "PortConnectivity", among "Common
Block Parameters";
2) use "get_param(<block>,'PortConnectivity')" to retrieve the
info from <block>;
3) iterate that appropriately (careful with subsystems boundaries and
their inports/outports).
Run some examples to familiarize with all that.
HTH
riccardo
devendra rai
2004-10-26 09:34:43 UTC
Permalink
Thanks a lot Riccardo. That was great help. But I came across another
problem. I am able to determine the source port handles of the
subsystem ( it happens to be a virtual block). The only problem is
that I feel this is a dead end. Inspite of my best efforts, I cannot
get INSIDE this source subsystem using the available information. (
SrcPortHandles traced back from the driven block). Is there any way
to getting arounf with this?? I would be glad if some body could
answer!

Thanks,

Devendra Rai
Post by riccardo
Post by devendra rai
Hi,
I have a simulink model. I wish to be able to select a block
and
Post by riccardo
be
Post by devendra rai
able to backtrack to all the non-virtual blocks that drive it.
I
Post by riccardo
Post by devendra rai
wish
to get this information in an m file ( or whatever file).
Is there any function to do this? Does matlab/simulink support this?
I shall be glad if somebody could help.
Thanks,
devnedra rai
Hi,
1) search the documentation for "PortConnectivity", among "Common
Block Parameters";
2) use "get_param(<block>,'PortConnectivity')" to retrieve
the
info from <block>;
3) iterate that appropriately (careful with subsystems boundaries and
their inports/outports).
Run some examples to familiarize with all that.
HTH
riccardo
riccardo
2004-10-26 13:57:27 UTC
Permalink
devendra rai wrote:
<snip> cannot figure how to track a source block through a
subsystem boundary
<snip>
Post by riccardo
(careful with subsystems boundaries
and
their inports/outports).
Src/Dst info in PortConnectivity provides handles of
source/destination blocks AND related port indexes as well (in the
range [0 : Nports-1] ).
If you have a block of 'BlockType' 'Subsystem', its I/O ports
correspond to the Inport/Outport blocks defined INSIDE it.
Get the list of those (with find_system(<ssblk>, ...) ) and use
the index from PortConnectivity to identify the one you want: then
you have again the handle of a block (inport or outport), with its
own PortConnectivity array, and you can go on.

hth
riccardo
riccardo-_-***@yahoo-.-co-.-uk
(no hyphens in my address)

Loading...