Main Content

Transport layer

Transport protocol for external mode communication

Model Configuration Pane: Code Generation / Interface

Description

The Transport layer parameter specifies the transport protocol that the code generator applies when producing code for communication between the Simulink® engine and a target system.

Dependency

To enable this parameter, select the External mode parameter.

Settings

tcpip (default) | serial | XCP on TCP/IP | XCP on Serial | customTransportLayer
tcpip

Uses a TCP/IP transport mechanism. Selecting this parameter sets parameter MEX-file name to ext_comm.

serial

Uses a serial transport mechanism. Selecting this parameter sets parameter MEX-file name to ext_serial_win32_comm.

XCP on TCP/IP

Uses XCP protocol with TCP/IP transport layer. Selecting this parameter sets parameter MEX-file name to ext_xcp.

XCP on Serial

Uses XCP protocol with serial transport layer. Selecting this parameter sets parameter MEX-file name to ext_xcp.

customTransportLayer

Uses a custom transport layer.

Tips

The Configuration Parameters dialog box displays parameter MEX-file name next to Transport layer. You cannot edit the value for MEX-file name. The value is specified in matlabroot/toolbox/simulink/simulink/extmode_transports.m for system target files that MathWorks® provides or in an sl_customization.m file for custom targets and transport mechanisms.

The command-line parameter is an index. To get the transport layer index, use these commands:

cs = getActiveConfigSet(modelName);
index = Simulink.ExtMode.Transports.getExtModeTransportIndex(cs, transportLayer);
transportLayer is one of these values:

  • 'tcpip'

  • 'serial'

  • 'XCP on TCP/IP'

  • 'XCP on Serial'

  • customTransportLayer

To set the transport layer:

set_param(cs, 'ExtModeTransport', index)

To determine the transport layer setting:

transportLayerName = Simulink.ExtMode.Transports.getExtModeTransport(cs, index)

Recommended Settings

ApplicationNo impact
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

Programmatic Use

Parameter: ExtModeTransport
Type: integer
Value: See Settings.
Default: 0

Version History

Introduced before R2006a