Thread Subject: external mode with custom RTW target

Subject: external mode with custom RTW target

From: Frederic

Date: 16 Nov, 2007 21:32:10

Message: 1 of 4

I have a problem to use "external mode" with a custom TLC
file that derives from grt.tlc (file is attached at the end
of this email).

When I set Interface to "External Mode" in RTW configuration
parameters, the "Transport Layer" control only contains the
"none" option.
When using the grt.tlc target it contains the expected
options "serial, tctpip...".

What do I need to change in my TLC file to have access to
those Transport layers?

I found-out that I can edit the mdl file and force the
"ExtModeMexFile" parameters to "ext_comm" instead of
"noextcomm" and it works! I can connect to my target from
Simulink.

But of course ExtModeMexFile is overwritten next time I save
the model. I need to be able to set the transport layer from
Simulink Configuration's dialog.

Thanks for any help

Frederic


%% SYSTLC: Test Target \
%% TMF: test.tmf MAKE: make_rtw EXTMODE: ext_comm
%%
%%
%selectfile NULL_FILE

%assign TargetType = "RT"
%assign Language = "C"
%assign GenRTModel = 1
%assign _GRT_ = 1

%assign MatFileLogging = 1

%include "codegenentry.tlc"


  BEGIN_RTW_OPTIONS

  rtwgensettings.DerivedFrom = 'grt.tlc';
  rtwgensettings.Version = '1';
  rtwgensettings.BuildDirSuffix = '_test_rtw';
  

  END_RTW_OPTIONS
 %/

Subject: external mode with custom RTW target

From: Frederic

Date: 19 Nov, 2007 22:06:16

Message: 2 of 4

I'm replying to myself, I found the solution after digging
through the m source files in the toolbox/simulink directory.

To add tcpip external mode support to a custom target,
create a sl_customization.m file with the following content:

function sl_customization(cm)
    disp('Adding tcpip external mode to test target');
    cm.ExtModeTransports.add('test.tlc', 'tcpip',
'ext_comm', 'Level1');
end

Mentioning this in the doc would be nice (in case somebody
at The Mathworks is reading this).

Frederic

"Frederic " <fred@nowhere.com> wrote in message
<fhl28q$4st$1@fred.mathworks.com>...
> I have a problem to use "external mode" with a custom TLC
> file that derives from grt.tlc (file is attached at the end
> of this email).
>
> When I set Interface to "External Mode" in RTW configuration
> parameters, the "Transport Layer" control only contains the
> "none" option.
> When using the grt.tlc target it contains the expected
> options "serial, tctpip...".
>
> What do I need to change in my TLC file to have access to
> those Transport layers?
>
> I found-out that I can edit the mdl file and force the
> "ExtModeMexFile" parameters to "ext_comm" instead of
> "noextcomm" and it works! I can connect to my target from
> Simulink.
>
> But of course ExtModeMexFile is overwritten next time I save
> the model. I need to be able to set the transport layer from
> Simulink Configuration's dialog.
>
> Thanks for any help
>
> Frederic
>
>
> %% SYSTLC: Test Target \
> %% TMF: test.tmf MAKE: make_rtw EXTMODE: ext_comm
> %%
> %%
> %selectfile NULL_FILE
>
> %assign TargetType = "RT"
> %assign Language = "C"
> %assign GenRTModel = 1
> %assign _GRT_ = 1
>
> %assign MatFileLogging = 1
>
> %include "codegenentry.tlc"
>
>
> BEGIN_RTW_OPTIONS
>
> rtwgensettings.DerivedFrom = 'grt.tlc';
> rtwgensettings.Version = '1';
> rtwgensettings.BuildDirSuffix = '_test_rtw';
>
>
> END_RTW_OPTIONS
> %/
>
>

Subject: external mode with custom RTW target

From: Aaron

Date: 22 Nov, 2007 04:24:11

Message: 3 of 4

Hi Frederic,

This will be doc'd in the R2008a release.

Thanks,
Aaron

"Frederic " <fred@nowhere.com> wrote in message <fht1co$li5
$1@fred.mathworks.com>...
> I'm replying to myself, I found the solution after digging
> through the m source files in the toolbox/simulink
directory.
>
> To add tcpip external mode support to a custom target,
> create a sl_customization.m file with the following
content:
>
> function sl_customization(cm)
> disp('Adding tcpip external mode to test target');
> cm.ExtModeTransports.add('test.tlc', 'tcpip',
> 'ext_comm', 'Level1');
> end
>
> Mentioning this in the doc would be nice (in case somebody
> at The Mathworks is reading this).
>
> Frederic
>
> "Frederic " <fred@nowhere.com> wrote in message
> <fhl28q$4st$1@fred.mathworks.com>...
> > I have a problem to use "external mode" with a custom
TLC
> > file that derives from grt.tlc (file is attached at the
end
> > of this email).
> >
> > When I set Interface to "External Mode" in RTW
configuration
> > parameters, the "Transport Layer" control only contains
the
> > "none" option.
> > When using the grt.tlc target it contains the expected
> > options "serial, tctpip...".
> >
> > What do I need to change in my TLC file to have access
to
> > those Transport layers?
> >
> > I found-out that I can edit the mdl file and force the
> > "ExtModeMexFile" parameters to "ext_comm" instead of
> > "noextcomm" and it works! I can connect to my target
from
> > Simulink.
> >
> > But of course ExtModeMexFile is overwritten next time I
save
> > the model. I need to be able to set the transport layer
from
> > Simulink Configuration's dialog.
> >
> > Thanks for any help
> >
> > Frederic
> >
> >
> > %% SYSTLC: Test Target \
> > %% TMF: test.tmf MAKE: make_rtw EXTMODE: ext_comm
> > %%
> > %%
> > %selectfile NULL_FILE
> >
> > %assign TargetType = "RT"
> > %assign Language = "C"
> > %assign GenRTModel = 1
> > %assign _GRT_ = 1
> >
> > %assign MatFileLogging = 1
> >
> > %include "codegenentry.tlc"
> >
> >
> > BEGIN_RTW_OPTIONS
> >
> > rtwgensettings.DerivedFrom = 'grt.tlc';
> > rtwgensettings.Version = '1';
> > rtwgensettings.BuildDirSuffix = '_test_rtw';
> >
> >
> > END_RTW_OPTIONS
> > %/
> >
> >
>

Subject: external mode with custom RTW target

From: Anthony Torres

Date: 18 Mar, 2010 17:23:05

Message: 4 of 4

As always your a plethora of information Aaron!

"Aaron " <aaron.drajpuch.nospam@mathworks.com> wrote in message <fi309b$4le$1@fred.mathworks.com>...
> Hi Frederic,
>
> This will be doc'd in the R2008a release.
>
> Thanks,
> Aaron
>
> "Frederic " <fred@nowhere.com> wrote in message <fht1co$li5
> $1@fred.mathworks.com>...
> > I'm replying to myself, I found the solution after digging
> > through the m source files in the toolbox/simulink
> directory.
> >
> > To add tcpip external mode support to a custom target,
> > create a sl_customization.m file with the following
> content:
> >
> > function sl_customization(cm)
> > disp('Adding tcpip external mode to test target');
> > cm.ExtModeTransports.add('test.tlc', 'tcpip',
> > 'ext_comm', 'Level1');
> > end
> >
> > Mentioning this in the doc would be nice (in case somebody
> > at The Mathworks is reading this).
> >
> > Frederic
> >
> > "Frederic " <fred@nowhere.com> wrote in message
> > <fhl28q$4st$1@fred.mathworks.com>...
> > > I have a problem to use "external mode" with a custom
> TLC
> > > file that derives from grt.tlc (file is attached at the
> end
> > > of this email).
> > >
> > > When I set Interface to "External Mode" in RTW
> configuration
> > > parameters, the "Transport Layer" control only contains
> the
> > > "none" option.
> > > When using the grt.tlc target it contains the expected
> > > options "serial, tctpip...".
> > >
> > > What do I need to change in my TLC file to have access
> to
> > > those Transport layers?
> > >
> > > I found-out that I can edit the mdl file and force the
> > > "ExtModeMexFile" parameters to "ext_comm" instead of
> > > "noextcomm" and it works! I can connect to my target
> from
> > > Simulink.
> > >
> > > But of course ExtModeMexFile is overwritten next time I
> save
> > > the model. I need to be able to set the transport layer
> from
> > > Simulink Configuration's dialog.
> > >
> > > Thanks for any help
> > >
> > > Frederic
> > >
> > >
> > > %% SYSTLC: Test Target \
> > > %% TMF: test.tmf MAKE: make_rtw EXTMODE: ext_comm
> > > %%
> > > %%
> > > %selectfile NULL_FILE
> > >
> > > %assign TargetType = "RT"
> > > %assign Language = "C"
> > > %assign GenRTModel = 1
> > > %assign _GRT_ = 1
> > >
> > > %assign MatFileLogging = 1
> > >
> > > %include "codegenentry.tlc"
> > >
> > >
> > > BEGIN_RTW_OPTIONS
> > >
> > > rtwgensettings.DerivedFrom = 'grt.tlc';
> > > rtwgensettings.Version = '1';
> > > rtwgensettings.BuildDirSuffix = '_test_rtw';
> > >
> > >
> > > END_RTW_OPTIONS
> > > %/
> > >
> > >
> >
>

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com