Skip to Main Content Skip to Search
Product Documentation

rtw.connectivity.ConfigRegistry - Register connectivity configuration

Syntax

config = rtw.connectivity.ConfigRegistry

Description

Use this class to register your connectivity configuration with Simulink by using the sl_customization.m mechanism. The connectivity configuration is registered by a call to registerTargetInfo inside a sl_customization.m file.

Create or add to your sl_customization.m file as shown in the Examples section, and place the file on the MATLAB path. Simulink software reads the sl_customization.m when it starts, and registers your connectivity configuration. This step also defines the set of Simulink models that the new connectivity configuration is compatible with.

A connectivity configuration must have a unique name and be associated with a connectivity implementation class (a subclass of rtw.connectivity.Config). The properties of the configuration (e.g. SystemTargetFile) define the set of Simulink models that the connectivity implementation class is compatible with. The properties are shown in the following table.

Properties of rtw.connectivity.ConfigRegistry

Property NameDescription
ConfigName Unique string name for this configuration
ConfigClass Full class name of the connectivity implementation (e.g. rtw.pil.myConnectivityConfig) to register.
SystemTargetFile Cell array of strings listing System Target Files that support this ConfigRegistry.
An empty cell array matches any System Target File.
The model's SystemTargetFileConfiguration Parameter is validated against this cell array to determine if this ConfigRegistry is valid for use.
TemplateMakefile Cell array of strings listing Template Makefiles that support this ConfigRegistry. An empty cell array matches any Template Makefile and nonmakefile based targets (GenerateMakefile: off).
The model's TemplateMakefile Configuration Parameter is validated against this cell array to determine if this ConfigRegistry is valid for use.
TargetHWDeviceType Cell array of strings listing Hardware Device Types that support this ConfigRegistry.
An empty cell array matches any Hardware Device Type.
The model's TargetHWDeviceTypeConfiguration Parameter is validated against this cell array to determine if this ConfigRegistry is valid for use.

Examples

The following code shows an example sl_customization.m registration. You must use the sl_customization.m file structure shown in the example following. You must call the registerTargetInfo function exactly as shown.

function sl_customization(cm)
% SL_CUSTOMIZATION for PIL connectivity config:...
% mypil.ConnectivityConfig

% Copyright 2008 The MathWorks, Inc.
% $Revision: 1.1.8.6 $

cm.registerTargetInfo(@loc_createConfig);

% local function
function config = loc_createConfig

config = rtw.connectivity.ConfigRegistry;
config.ConfigName = 'My PIL Example';
config.ConfigClass = 'mypil.ConnectivityConfig';

% match only ert.tlc
config.SystemTargetFile = {'ert.tlc'};
% match the standard ert TMF's
config.TemplateMakefile = {'ert_default_tmf' ...
                           'ert_unix.tmf', ...
                           'ert_vc.tmf', ...
                           'ert_vcx64.tmf', ...
                           'ert_lcc.tmf'};
% match regular 32-bit machines and Custom for e.g. ...
% 64-bit Linux
config.TargetHWDeviceType = {'Generic->32-bit x86 ...
                              compatible'
                             'Generic->Custom'};

You must configure the file to perform the following steps when Simulink software starts:

  1. Create an instance of the rtw.connectivity.ConfigRegistry class. For example,

    config = rtw.connectivity.ConfigRegistry;
  2. Assign a connectivity configuration name to the ConfigName property of the object. For example,

    config.ConfigName = 'My PIL Example';
  3. Associate the connectivity configuration with the connectivity API implementation (created in step 1). For example,

    config.ConfigClass = 'mypil.ConnectivityConfig';
  4. Define compatible models for this target connectivity configuration, by setting the SystemTargetFile, TemplateMakefile and TargetHWDeviceType properties of the object. For example,

    % match only ert.tlc
    config.SystemTargetFile = {'ert.tlc'};
    % match the standard ert TMF's
    config.TemplateMakefile = {'ert_default_tmf' ...
                               'ert_unix.tmf', ...
                               'ert_vc.tmf', ...
                               'ert_vcx64.tmf', ...
                               'ert_lcc.tmf'};
    % match regular 32-bit machines and Custom for e.g. ...
    % 64-bit Linux
    config.TargetHWDeviceType = {'Generic->32-bit x86 ...
                                  compatible'
                                 'Generic->Custom'};

See Also

rtw.connectivity.Config

How To

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS