Real-Time Workshop Pane: Interface

Interface Tab Overview

Select the target software environment, output variable name modifier, and data exchange interface.

See Also

Configuring Model Interfaces

Target function library

Specify a target-specific math library for your model.

Settings

Default: C89/C90 (ANSI)

C89/C90 (ANSI)

Generates calls to the ISO/IEC 9899:1990 C standard math library for floating-point functions.

C99 (ISO)

Generates calls to the ISO/IEC 9899:1999 C standard math library.

GNU99 (GNU)

Generates calls to the GNU gcc math library, which provides C99 extensions as defined by compiler option -std=gnu99.

Tip

Before setting this parameter, verify that your compiler supports the library you want to use. If you select a parameter value that your compiler does not support, compiler errors can occur.

Command-Line Information

Parameter: GenFloatMathFcnCalls
Type: string
Value: 'ANSI_C' | 'C99 (ISO)' | 'GNU99 (GNU)'
Default: 'ANSI_C'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyAny valid library
Safety precautionNo impact

See Also

Configuring Model Interfaces

Utility function generation

Specify the location for generating utility functions.

Settings

Default: Auto

Auto

Operates as follows:

Shared location

Directs code for utilities to be placed within the slprj directory in your working directory.

Command-Line Information

Parameter: UtilityFuncGeneration
Type: string
Value: 'Auto' | 'Shared location'
Default: 'Auto'

Recommended Settings

ApplicationSetting
DebuggingShared location (GRT)
No impact (ERT)
TraceabilityShared location (GRT)
No impact (ERT)
EfficiencyShared location
Safety precautionNo impact

See Also

Configuring Model Interfaces

Support: floating-point numbers

Specify whether to generate floating-point data and operations.

Settings

Default: on

On

Generates floating-point data and operations.

Off

Generates pure integer code. If you clear this option, an error occurs if the code generator encounters floating-point data or expressions. The error message reports offending blocks and parameters.

Dependencies

Command-Line Information

Parameter: PurelyIntegerCode
Type: string
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOff (for integer only)
Safety precautionNo impact

Support: absolute time

Specify whether to generate and maintain integer counters for absolute and elapsed time values.

Settings

Default: on

On

Generates and maintains integer counters for blocks that require absolute or elapsed time values. Absolute time is the time from the start of program execution to the present time. An example of elapsed time is time elapsed between two trigger events.

If you select this option and the model does not include blocks that use time values, the target does not generate the counters.

Off

Does not generate integer counters to represent absolute or elapsed time values. If you do not select this option and the model includes blocks that require absolute or elapsed time values, an error occurs during code generation.

Dependencies

Command-Line Information

Parameter: SupportAbsoluteTime
Type: string
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOff
Safety precautionOff

See Also

Timing Services

Support: non-finite numbers

Specify whether to generate nonfinite data and operations.

Settings

Default: on

On

Generates nonfinite data (for example, NaN and Inf) and related operations.

Off

Does not generate nonfinite data and operations. If you clear this option, an error occurs if the code generator encounters nonfinite data or expressions. The error message reports offending blocks and parameters.

Dependencies

Command-Line Information

Parameter: SupportNonFinite
Type: string
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOff
Safety precautionOff

Support: continuous time

Specify whether to generate code for blocks that use continuous time.

Settings

Default: off

On

Generates code for blocks that use continuous time.

Off

Does not generate code for blocks that use continuous time. If you do not select this option and the model includes blocks that use continuous time, an error occurs during code generation.

Dependencies

Command-Line Information

Parameter: SupportContinuousTime
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOff
Safety precautionOff

See Also

Support: complex numbers

Specify whether to generate complex data and operations.

Settings

Default: on

On

Generates complex numbers and related operations.

Off

Does not generate complex data and related operations. If you clear this option, an error occurs if the code generator encounters complex data or expressions. The error message reports offending blocks and parameters.

Dependencies

Command-Line Information

Parameter: SupportComplex
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOff (for real only)
Safety precautionNo impact

Support: non-inlined S-functions

Specify whether to generate code for noninlined S-functions.

Settings

Default: Off

On

Generates code for noninlined S-functions.

Off

Does not generate code for noninlined S-functions. If this parameter is off and the model includes a noninlined S-function, an error occurs during the build process.

Tip

Dependencies

Command-Line Information

Parameter: SupportNonInlinedSFcns
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOff
Safety precautionOff

See Also

GRT compatible call interface

Specify whether to generate model function calls compatible with the main program module of the GRT target.

Settings

Default: off

On

Generates model function calls that are compatible with the main program module of the GRT target (grt_main.c or grt_main.cpp).

This option provides a quick way to use ERT target features with a GRT-based custom target that has a main program module based on grt_main.c or grt_main.cpp.

Off

Disables the GRT compatible call interface.

Tips

The following are unsupported:

Dependencies

Command-Line Information

Parameter: GRTInterface
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityOff
EfficiencyOff
Safety precautionOff

See Also

Support for Continuous Time Blocks, Continuous Solvers, and Stop Time

Single output/update function

Specify whether to generate the model_step function.

Settings

Default: on

On

Generates the model_step function for a model. This function contains the output and update function code for all blocks in the model and is called by rt_OneStep to execute processing for one clock period of the model at interrupt level.

Off

Does not combine output and update function code for model blocks in a single function. Generates the code in model.output and model.update.

Tips

Errors or unexpected behavior can occur if a Model block is part of a cycle, the Model block is a direct feedthrough block, and an algebraic loop results. See Model Blocks and Direct Feedthrough for details.

Dependencies

Command-Line Information

Parameter: CombineOutputUpdateFcns
Type: string
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyOn
Safety precautionOn

See Also

rt_OneStep

Terminate function required

Specify whether to generate the model_terminate function.

Settings

Default: on

On

Generates a model_terminate function. This function contains all model termination code and should be called as part of system shutdown.

Off

Does not generate a model.terminate function. Suppresses the generation of this function if you designed your application to run indefinitely and does not require a terminate function.

Dependencies

Command-Line Information

Parameter: IncludeMdlTerminateFcn
Type: string
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOff
Safety precautionOff

See Also

model_terminate

Generate reusable code

Specify whether to generate reusable, reentrant code.

Settings

Default: off

On

Generates reusable, multi-instance code that is reentrant. The code generator passes model data structures (root-level inputs and outputs, block states, parameters, and external outputs) in, by reference, as arguments to model_step and other the model entry point functions. The data structures are also exported with model.h. For efficiency, the code generator passes in only data structures that are used. Therefore, when you select this option, the argument lists generated for the entry point functions vary according to model requirements.

Off

Does not generate reusable code. Model data structures are statically allocated and accessed by model entry point functions directly in the model code.

Tips

Dependencies

Command-Line Information

Parameter: MultiInstanceERTCode
Type: string
Value: 'on' | 'off'
Default: 'on'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyOn (for single instance)
Safety precautionNo impact

See Also

Reusable code error diagnostic

Select the severity level for diagnostics displayed when a model violates requirements for generating reusable code.

Settings

Default: Error

None

Proceed with build without displaying a diagnostic message.

Warning

Proceed with build after displaying a warning message.

Error

Abort build after displaying an error message.

Under certain conditions, the Real-Time Workshop Embedded Coder software might

Dependencies

Command-Line Information

Parameter: MultiInstanceErrorCode
Type: string
Value: 'None' | 'Warning' | 'Error'
Default: 'Error'

Recommended Settings

ApplicationSetting
DebuggingWarning or Error
TraceabilityNo impact
EfficiencyNone
Safety precautionNo impact

See Also

Pass root-level I/O as

Control how root-level model input and output are passed to the model_step function.

Settings

Default: Individual arguments

Individual arguments

Passes each root-level model input and output value to model_step as a separate argument.

Structure reference

Packs all root-level model input into a struct and passes struct to model_step as an argument. Similarly, packs root-level model output into a second struct and passes it to model_step.

Dependencies

Command-Line Information

Parameter: RootIOFormat
Type: string
Value: 'Individual arguments' | 'Structure reference'
Default: 'Individual arguments'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Suppress error status in real-time model data structure

Specify whether to log or monitor error status.

Settings

Default: off

On

Omits the error status field from the generated real-time model data structure rtModel. This option reduces memory usage.

Selecting this option can cause the code generator to completely omit the rtModel data structure from generated code.

Off

Includes an error status field in the generated real-time model data structure rtModel. You can use available macros to monitor the field for or set it with error message data.

Dependencies

Command-Line Information

Parameter: SuppressErrorStatus
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOff
TraceabilityNo impact
EfficiencyOn
Safety precautionOn

See Also

rtModel Accessor Macros

Configure Step Function

Use the Configure Step Function button to open the Model Interface dialog box. This dialog box provides a way for you to specify whether the code generator is to use a default model_step function prototype or a model-specific C prototype. Based on your selection, you can preview and modify the function prototype.

Dependency

This parameter only appears for ERT-based targets.

See Also

Create Simulink (S-Function) block

Specify whether to generate an S-function block.

Settings

Default: off

On

Generates an S-function block to represent the model or subsystem. The coder generates an inlined C or C++ MEX S-function wrapper that calls existing hand-written code or code previously generated by the Real-Time Workshop software from within the Simulink® product. S-function wrappers provide a standard interface between the Simulink product and externally written code, allowing you to integrate your code into a model with minimal modification.

When this option is selected, the Real-Time Workshop software:

  1. Generates the S-function wrapper file model_sf.c (or .cpp) and places it in the build directory.

  2. Builds the MEX-file model_sf.mexext and places it in your working directory.

  3. Creates and opens an untitled model containing the generated S-Function block.

Off

Does not generate an S-function block.

Dependency

This parameter only appears for ERT-based targets.

Command-Line Information

Parameter: GenerateErtSFunction
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Enable portable word sizes

Specify whether to allow portability across host and target processors that support different word sizes.

Settings

Default: off

On

Generates conditional processing macros that support compilation of generated code on a processor that supports a different word size than the target processor on which production code is intended to run (for example, a 32-bit host and a 16-bit target. This allows you to use the same generated code for both software-in-the-loop (SIL) testing on the host platform and production deployment on the target platform.

Off

Does not generate portable code.

Dependencies

Command-Line Information

Parameter: PortableWordSizes
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityOn
EfficiencyOff
Safety precautionNo impact

See Also

MAT-file logging

Specify whether to enable MAT-file logging.

Settings

Default: off

On

Enables MAT-file logging. When you select this option, the code generator saves system states, output, and simulation time at each model execution time step. The data is written to a MAT-file, named (by default) model.mat, where model is the name of your model.

Off

Disables MAT-file logging. Clearing this option has the following benefits:

  • Eliminates overhead associated with supporting a file system, which typically is not needed for embedded applications

  • Eliminates extra code and memory usage required to initialize, update, and clean up logging variables

  • Under certain conditions, eliminates code and storage associated with root output ports

  • Omits the comparison between the current time and stop time in the model_step, allowing the generated program to run indefinitely, regardless of the stop time setting

Dependencies

Command-Line Information

Parameter: MatFileLogging
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingOn
TraceabilityNo impact
EfficiencyOff
Safety precautionOff

See Also

Using Virtualized Output Ports Optimization

MAT-file variable name modifier

Select the string to add to MAT-file variable names.

Settings

Default: rt_

rt_

Adds a prefix string.

_rt

Adds a suffix string.

none

Does not add a string.

Dependency

When an ERT target is selected, this parameter is enabled by MAT-file logging.

Command-Line Information

Parameter: LogVarNameModifier
Type: string
Value: 'none' | 'rt_' | '_rt'
Default: 'rt_'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Data Logging

Interface

Specify the data exchange interface (API) to include.

Settings

Default: None

None

Does not include an API in the generated code.

C-API

Uses the C-API data interface.

External mode

Uses an external data interface.

ASAP2

Uses the ASAP2 data interface.

Dependencies

Selecting C-API enables the following parameters:

Selecting External mode enables the following parameters:

Command-Line Information

Parameter: see table
Type: string
Value: 'on' | 'off'
Default: 'off'
To enable...Set this parameter...To this value...
noneRTWCAPIParams,
RTWCAPISignals,
ExtMode,
GenerateASAP2
'off'
C APIRTWCAPIParams |
RTWCAPISignals
'on'
External modeExtMode'on'
ASAP2GenerateASAP2'on'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact during development
None for production code generation

See Also

Signals in C API

Generate a C API signal structure.

Settings

Default: on

On

Generates C API for global block outputs.

Off

Does not generate C API signals.

Dependency

This parameter is enabled by selecting Interface > C-API.

Command-Line Information

Parameter: RTWCAPISignals
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

C-API for Interfacing with Signals and Parameters

Parameters in C API

Generate C API parameter tuning structures.

Settings

Default: on

On

Generates C API for global block and model parameters.

Off

Does not generate C API parameters.

Dependency

This parameter is enabled by selecting Interface > C-API.

Command-Line Information

Parameter: RTWCAPIParams
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

C-API for Interfacing with Signals and Parameters

Transport layer

Specify the transport protocol for external mode communications.

Settings

Default: tcpip

tcpip

Applies a TCP/IP transport mechanism. The MEX-file name is ext_comm.

serial_win32

Applies a serial transport mechanism. The MEX-file name is ext_serial_win32_comm.

Tip

The MEX-file name displayed next to Transport layer cannot be edited in the Configuration Parameters dialog box. The value is specified either in matlabroot/toolbox/simulink/simulink/extmode_transports.m, for targets provided by The MathWorks, or in an sl_customization.m file, for custom targets and/or custom external mode transports.

Dependency

This parameter is enabled by selecting External mode in the Interface parameter.

Command-Line Information

Parameter: ExtModeTransport
Type: integer
Value: 0 | 1
Default: 0

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

MEX-file arguments

Specify arguments to pass to an external mode interface MEX-file for communicating with executing targets.

Settings

Default: ""

For TCP/IP interfaces, ext_comm allows three optional arguments:

For a serial transport, ext_serial_win32_comm allows three optional arguments:

Dependency

Depending on the specified target, this parameter is enabled by Data Exchange > Interface > External mode or by External Mode.

Command-Line Information

Parameter: ExtModeMexArgs
Type: string
Value: any valid arguments
Default: ""

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

Static memory allocation

Control memory buffer for external mode communication.

Settings

Default: off

On

Enables the Static memory buffer size parameter for allocating dynamic memory.

Off

Uses a static memory buffer for external mode instead of allocating dynamic memory (calls to malloc).

Tip

To determine how much memory you need to allocate, select verbose mode on the target to display the amount of memory it tries to allocate and the amount of memory available.

Dependencies

Command-Line Information

Parameter: ExtModeStaticAlloc
Type: string
Value: 'on' | 'off'
Default: 'off'

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

External Mode Interface Options

Static memory buffer size

Specify the memory buffer size for external mode communication.

Settings

Default: 1000000

Enter the number of bytes to preallocate for external mode communications buffers in the target.

Tips

Dependency

This parameter is enabled by Static memory allocation.

Command-Line Information

Parameter: ExtModeStaticAllocSize
Type: integer
Value: any valid value
Default: 1000000

Recommended Settings

ApplicationSetting
DebuggingNo impact
TraceabilityNo impact
EfficiencyNo impact
Safety precautionNo impact

See Also

External Mode Interface Options

  


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