Main Content

rtw.connectivity.Config

Define connectivity implementation that comprises builder, launcher, and communicator components

Description

The rtw.connectivity.Config class specifies the actions required for running a processor-in-the-loop (PIL) simulation.

Creation

Description

example

rtw.connectivity.Config(componentArgs, builder, launcher, communicator) creates an rtw.connectivity.Config object with these arguments:

  • componentArgsrtw.connectivity.ComponentArgs object

  • builderrtw.connectivity.Builder object, for example, rtw.connectivity.MakefileBuilder object.

  • launcherrtw.connectivity.Launcher object

  • communicatorrtw.connectivity.Communicator, for example, rtw.connectivity.RtIOStreamHostCommunicator object.

To define a connectivity implementation:

  1. Create a subclass of rtw.connectivity.Config that creates instances of your connectivity component classes:

    • rtw.connectivity.MakefileBuilder

    • rtw.connectivity.Launcher

    • rtw.connectivity.RtIOStreamHostCommunicator

  2. Define the constructor for your subclass:

    function this = myConfig(componentArgs)

    When the software creates an instance of your subclass of rtw.connectivity.Config, it provides an instance of the rtw.connectivity.ComponentArgs class as the only constructor argument. If you want to test your subclass of rtw.connectivity.Config manually, you can create an rtw.connectivity.ComponentArgs object to pass as a constructor argument.

  3. After instantiating the builder, launcher and communicator objects in your subclass, call the constructor of the superclass rtw.connectivity.Config to define your complete target connectivity configuration. For example:

    this@rtw.connectivity.Config(componentArgs,...
    builder, launcher, communicator);
    
  4. Optionally, for execution-time profiling, use the setTimer method to register your hardware timer. For example, if you specified the timer in a code replacement table, insert the following line:

    this.setTimer('myCrlTable')
    myCrlTable is the name of the code replacement table, which must be in a location on the MATLAB® search path.

    You can also estimate and remove instrumentation overheads from execution-time measurements. For example:

    this.activateOverheadFiltering(true);
    this.runOverheadBenchmark(true);
    this.setOverheadBenchmarkSteps(50);

  5. Optionally, for stack usage profiling, use the setStackDriver method to specify a driver implementation that obtains stack usage data from the target hardware. For example, if you use coder.profile.StackDriver to create the object stackUsageDriver, insert the following line:

    this.setStackDriver(stackUsageDriver)

Register your subclass name, for example, myPIL.ConnectivityConfig by using the class rtw.connectivity.ConfigRegistry. The PIL infrastructure instantiates your subclass as required. The rtwTargetInfo.m file (for MATLAB) or sl_customization.m mechanism (for Simulink®) specifies a suitable connectivity configuration for use with a particular PIL component (and its configuration set). The subclass can also perform additional validation on construction. For example, you can use the component path returned by the getComponentPath method of the componentArgs constructor argument to query and validate parameters associated with the PIL component under test.

Examples

Using rtw.connectivity.Config in PIL Connectivity

For an example that shows how to use this object in setting up PIL connectivity, see:

Version History

Introduced in R2008b