Documentation

Code Generation Configuration Parameters

Simulink Real-Time Options Pane

Control the code created by Simulink® Coder™ code generation software for a Simulink Real-Time™ application. Set up general information about building real-time applications, including target, execution, data logging, and other options.

Configuration

The Simulink Real-Time Options node in the Configuration Parameters dialog box allows you to specify how the software generates the real-time application. To reveal the Simulink Real-Time Options node, do the following:

  1. In the Code Generation pane, in the System target file list, select one of these settings:

    • slrt.tlc

      Generate system target code for Simulink Real-Time.

    • slrtert.tlc

      Generate system target code for a Simulink Real-Time using the required Embedded Coder® software.

      Note:   If you open a model that was originally saved with System target file set to xpctarget.tlc, the software updates the setting to slrt.tlc, and likewise with xpctargetert.tlc and slrtert.tlc. To retain the updated setting, save the updated model.

  2. Select C for the Language parameter on the code generation pane.

Tips

  • The default values work for the generation of most real-time applications. If you want to customize the build of your real-time application, set the option parameters to suit your specifications.

  • To access configuration parameters from the MATLAB® command line, use:

    • gcs — To access the current model.

    • set_param — To set the parameter value.

    • get_param — To get the current value of the parameter.

  • If you set up your model to Simulink Real-Time Embedded Coder (slrtert.tlc), you can create a custom Code Replacement Library (CRL). The CRL must be based on the Simulink Real-Time BLAS (XPC_BLAS). For more information, see:

Build for default target computer

Direct Simulink Coder to download the real-time application to the default target computer.

Settings

Default: on

On

Downloads the real-time application to the default target computer. Assumes that you configured a default target computer through Simulink Real-Time Explorer.

Off

Enables the Specify target computer name field so that you can enter the target computer to which to download the real-time application.

Dependency

When cleared, this parameter enables Specify target computer name.

Command-Line Information

Parameter: xPCisDefaultEnv
Type: character vector
Value: 'on' | 'off'
Default: 'on'

See Also

PCI Bus Ethernet Setup

USB-to-Ethernet Setup

Specify target computer name

Specify a target computer name for your real-time application.

Settings

''

Tip

The target computer name appears in Simulink Real-Time Explorer as the target computer node, for example TargetPC1.

Dependencies

To enable this parameter, clear Download to default target computer.

Command-Line Information

Parameter: xPCTargetPCEnvName
Type: character vector
Value: Any valid target computer
Default: ''

See Also

Simulink Real-Time Explorer Basic Operations

Automatically download application after building

Enable Simulink Coder to build and download the real-time application to the target computer.

Settings

Default: on

On

Builds and downloads the real-time application to the target computer.

Off

Builds the real-time application, but does not download it to the target computer.

Command-Line Information

Parameter: xPCisDownloadable
Type: character vector
Value: 'on' | 'off'
Default: 'on'

See Also

Build and Download Real-Time Application

Name of Simulink Real-Time object created by build process

Enter the name of the target object created by the build process.

Settings

Default: tg

Tip

Use this name when you work with the target object through the command-line interface.

Command-Line Information

Parameter: RL32ObjectName
Type: character vector
Value: 'tg' | valid target object name
Default: 'tg'

See Also

Real-Time Application Objects

Use default communication timeout

Direct Simulink Real-Time software to wait 5 (default) seconds for the real-time application to be downloaded to the target computer.

Settings

Default: on

On

Waits the default amount of seconds (5) for the real-time application to be downloaded to the target computer.

Off

Enables the Specify the communication timeout in seconds field so that you can enter the maximum length of time in seconds you want to wait for a real-time application to be downloaded to the target computer.

Dependencies

This parameter enables Specify the communication timeout in seconds.

Command-Line Information

Parameter: xPCisModelTimeout
Type: character vector
Value: 'on' | 'off'
Default: 'on'

See Also

Communications Timeout

Specify the communication timeout in seconds

Specify a timeout, in seconds, to wait for the real-time application to download to the target computer.

Settings

Default: 5

Tip

Enter the maximum length of time in seconds you want the Simulink Real-Time software to wait for the real-time application to download to the target computer. If the real-time application is not downloaded within this time frame, the software generates an error.

Dependencies

To enable this parameter, set Use default communication timeout.

Command-Line Information

Parameter: xPCModelTimeoutSecs
Type: character vector
Value: Any valid number of seconds
Default: '5'

See Also

Communications Timeout

Execution mode

Specify execution mode of downloaded code.

Settings

Default: Real-Time

Real-Time

Executes downloaded code as a real-time application.

Freerun

Executes downloaded code as fast as possible.

Multirate models cannot be executed in Freerun execution mode. On the Solver pane in the Configuration Parameters dialog box, clear the check box for Treat each discrete rate as a separate task.

Command-Line Information

Parameter: RL32ModeModifier
Type: character vector
Value: 'Real-Time' | 'Freerun'
Default: 'Real-Time'

Real-time interrupt source

Select a real-time interrupt source from the I/O board.

Settings

Default: Timer

Timer

Specifies that the board interrupt source is a timer.

Auto (PCI only)

Enables the Simulink Real-Time software to automatically determine the IRQ that the BIOS assigned to the board and use it.

3 to 15

Specifies that the board interrupt source is an IRQ number on the board.

Tips

  • The Auto (PCI only) option is available only for PCI boards. If you have an ISA board (PC/104 or onboard parallel port), set the IRQ manually.

  • The Simulink Real-Time software treats PCI parallel port plug-in boards like ISA boards. For PCI parallel port plug-in boards, set the IRQ manually.

  • Multiple boards can share an interrupt number.

Command-Line Information

Parameter: RL32IRQSourceModifier
Type: character vector
Value: 'Timer' | Auto (PCI only) | '3'|'4'|'5' | '6'|'7' |'8' |'9' |'10' |'11' |'12' |'13' |'14' |'15'
Default: 'Timer'

I/O board generating the interrupt

Specify the board interrupt source.

Settings

Default: None/Other

ATI-RP-R5

Specifies that the interrupt source is an ATI-RP-R5 board.

Bitflow NEON

Specifies that the interrupt source is the BitFlow™ NEON video board.

Busmirror EB5100

Specifies that the interrupt source is the Busmirror EB5100 FlexRay™ board.

CB_CIO-CTR05

Specifies that the interrupt source is the Measurement Computing™ CIO-CTR05 board.

CB_PCI-CTR05

Specifies that the interrupt source is the Measurement Computing PCI-CTR05 board.

Diamond_MM-32

Specifies that the interrupt source is the Diamond Systems MM-32 board.

FastComm 422/2-PCI

Specifies that the interrupt source is the Fastcom® 422/2-PCI board.

FastComm 422/2-PCI-335

Specifies that the interrupt source is the Fastcom 422/2-PCI-335 board.

FastComm 422/4-PCI-335

Specifies that the interrupt source is the Fastcom 422/4-PCI-335 board.

GE_Fanuc(VMIC)_PCI-5565

Specifies that the interrupt source is the GE® Fanuc VMIC PCI-5565 board.

General Standards 24DSI12

Specifies that the interrupt source is the General Standards 24DSI12 board.

Parallel_Port

Specifies that the interrupt source is the parallel port of the target computer.

Quatech DSCP-200/300

Specifies that the interrupt source is the Quatech® DSCP-200/300 board.

Quatech ESC-100

Specifies that the interrupt source is the Quatech ESC-100 board.

Quatech QSC-100

Specifies that the interrupt source is the Quatech QSC-100 board.

Quatech QSC-200/300

Specifies that the interrupt source is the Quatech QSC-200/300 board.

RTD_DM6804

Specifies that the interrupt source is the Real-Time Devices DM6804 board.

SBS_25x0_ID_0x100

Specifies that the interrupt source is an SBS Technologies shared memory board associated with ID 0x100.

SBS_25x0_ID_0x101

Specifies that the interrupt source is an SBS Technologies shared memory board associated with ID 0x101.

SBS_25x0_ID_0x102

Specifies that the interrupt source is an SBS Technologies shared memory board associated with ID 0x102.

SBS_25x0_ID_0x103

Specifies that the interrupt source is an SBS Technologies shared memory board associated with ID 0x103.

Scramnet_SC150+

Specifies that the interrupt source is the Systran® Scramnet+ SC150 board.

Softing_CAN-AC2-104

Specifies that the interrupt source is the Softing® CAN-AC2-104 board.

Softing_CAN-AC2-PCI

Specifies that the interrupt source is the Softing CAN-AC2-PCI board.

Speedgoat_IO301

Specifies that the interrupt source is the Speedgoat IO301 FPGA board.

Speedgoat_IO302

Specifies that the interrupt source is the Speedgoat IO302 FPGA board.

Speedgoat_IO303

Specifies that the interrupt source is the Speedgoat IO303 FPGA board.

Speedgoat_IO311

Specifies that the interrupt source is the Speedgoat IO311 FPGA board.

Speedgoat_IO312

Specifies that the interrupt source is the Speedgoat IO312 FPGA board.

Speedgoat_IO313

Specifies that the interrupt source is the Speedgoat IO313 FPGA board.

Speedgoat_IO314

Specifies that the interrupt source is the Speedgoat IO314 FPGA board.

Speedgoat_IO321

Specifies that the interrupt source is the Speedgoat IO321 FPGA board.

Speedgoat_IO331

Specifies that the interrupt source is the Speedgoat IO331 FPGA board.

Speedgoat_IO333

Specifies that the interrupt source is the Speedgoat IO333 FPGA board.

UEI_MFx

Specifies that the interrupt source is a United Electronic Industries UEI-MF series board.

None/Other

Specifies that the I/O board has no interrupt source.

Command-Line Information

Parameter: xPCIRQSourceBoard
Type: character vector
Value: 'ATI-RP-R5' |
'Bitflow NEON' |
'Busmirror EB5100' |
'CB_CIO-CTR05' |
'CB_PCI-CTR05' |
'Diamond_MM-32' |
'FastComm 422/2-PCI' |
'FastComm 422/2-PCI-335' |
'FastComm 422/4-PCI-335' |
'GE_Fanuc(VMIC)_PCI-5565' |
'General Standards 24DSI12' |
'Parallel_Port' |
'Quatech DSCP-200/300' |
'Quatech ESC-100' |
'Quatech QSC-100' |
'Quatech QSC-200/300' |
'RTD_DM6804' |
'SBS_25x0_ID_0x100' |
'SBS_25x0_ID_0x101' |
'SBS_25x0_ID_0x102' |
'SBS_25x0_ID_0x103' |
'Scramnet_SC150+' |
'Softing_CAN-AC2-104' |
'Softing_CAN-AC2-PCI' |
'Speedgoat_IO301' |
'Speedgoat_IO302' |
'Speedgoat_IO303' |
'Speedgoat_IO311' |
'Speedgoat_IO312' |
'Speedgoat_IO313' |
'Speedgoat_IO314' |
'Speedgoat_IO321' |
'Speedgoat_IO331' |
'Speedgoat_IO333' |
'UEI_MFx' |
'None/Other'
Default: 'None/Other'

PCI slot (-1: autosearch) or ISA base address

Enter the slot number or base address for the I/O board generating the interrupt.

Settings

Default: -1

The PCI slot can be either -1 (let the Simulink Real-Time software determine the slot number) or of the form [bus, slot].

The base address is a hexadecimal number of the form 0x300.

Tip

To determine the bus and PCI slot number of the boards in the target computer, in the Command Window, type:

tg = slrt;
getPCIInfo(tg, 'installed')

Command-Line Information

Parameter: xPCIOIRQSlot
Type: character vector
Value: '-1' | hexadecimal value
Default: '-1'

See Also

PCI Bus I/O Devices

Log Task Execution Time

Log task execution times to the target object property tg.TETlog.

Task Execution Time (TET) measures how long it takes the kernel to run for one base-rate time step. For a multirate model, use the profiler to find out what the execution time is for each rate.

Settings

Default: on

On

Logs task execution times to the target object property tg.TETlog.

Off

Does not log task execution times to the target object property tg.TETlog.

Command-Line Information

Parameter: RL32LogTETModifier
Type: character vector
Value: 'on' | 'off'
Default: 'on'

See Also

Signal Logging Basics

Signal logging data buffer size in doubles

Enter the maximum number of sample points to save before wrapping.

Settings

Default: 100000

The maximum value for this option cannot exceed the available target computer memory, which the Simulink Real-Time software also uses to hold other items.

Tips

  • Real-time applications use this buffer to store the time, states, outputs, and task execution time (TET) logs as defined in the Simulink model.

  • The maximum value for this option derives from available target computer memory, which the Simulink Real-Time software also uses to hold other items. For example, in addition to signal logging data, the software also uses the target computer memory for the Simulink Real-Time kernel, real-time application, and scopes.

    For example, assume that your model has six data items (time, two states, two outputs, and task execution time). If you enter a buffer size of 100000, the target object property tg.MaxLogSamples is calculated as floor(100000 / 6) = 16666. After the buffer saves 16666 sample points, it wraps and further samples overwrite the older ones.

  • Suppose that you enter a logging buffer size larger than the available RAM on the target computer. When you download and initialize the real-time application, the target computer displays a message, ERROR: allocation of logging memory failed. To avoid this error, either install more RAM or reduce the buffer size for logging, and then restart the target computer. To calculate the maximum buffer size available for your real-time application logs, divide the amount of available RAM on your target computer by sizeof(double), or 8. Enter that value for the Signal logging data buffer size in doubles value.

Command-Line Information

Parameter: RL32LogBufSizeModifier
Type: character vector
Value: '100000' | any valid memory size
Default: '100000'

Number of profiling events (each uses 20 bytes)

Enter the maximum of events to log for the profiling tool.

Settings

Default: 5000

The maximum number of events to be logged for the profiling tool.

Tips

  • An event is the start of end of an interrupt or iteration of the model. For example, one sample can four events: the beginning and end of an interrupt, and the beginning and end of an iteration.

  • Each event contains information such as the CPU ID, model thread ID (TID), event ID, and time stamp readings. Each event occupies 20 bytes.

Command-Line Information

Parameter: xPCRL32EventNumber
Type: character vector
Value: any valid number of events
Default: '5000'

See Also

Execution Profiling for Real-Time Applications

Double buffer parameter changes

Use a double buffer for parameter tuning. This setting enables parameter tuning so that the process of changing parameters in the real-time application uses a double buffer.

Settings

Default: off

On

Changes parameter tuning to use a double buffer.

Off

Suppresses double buffering of parameter changes in the real-time application.

Tips

  • When a parameter change request is received, the new value is compared to the old one. If the new value is identical to the old one, it is discarded, and if different, it is queued.

  • At the start of execution of the next sample of the real-time task, the queued parameters are updated. This operation increases the task execution time (TET) and can cause a CPU overload error.

  • Double buffering leads to a more robust parameter tuning interface, but it increases task execution time and the higher probability of overloads. Under typical conditions, keep double buffering off (default).

  • If the real-time application contains MATLAB variables as the value of block parameters, the software ignores this double buffering setting. Normal parameter tuning occurs.

Command-Line Information

Parameter: xpcDblBuff
Type: character vector
Value: 'on' | 'off'
Default: 'off'

Load a parameter set from a file on the designated target file system

Automatically load a parameter set from a file on the designated target computer file system.

Settings

Default: off

On

Enable the automatic loading of a parameter set from the file specified by File name on the designated target computer file system.

Off

Suppress the automatic loading of a parameter set from a file on the designated target computer file system.

Dependencies

This parameter enables File name.

Command-Line Information

Parameter: xPCLoadParamSetFile
Type: character vector
Value: 'on' | 'off'
Default: 'off'

See Also

Save and Reload Parameters with MATLAB Language

File name

Specify the target computer file name from which to load the parameter set.

Settings

''

Tip

If the named file does not exist, the software loads the parameter set built with the model.

Dependencies

To enable this parameter, set Load a parameter set from a file on the designated target file system.

Command-Line Information

Parameter: xPCOnTgtParamSetFileName
Type: character vector
Value: Any valid file name
Default: ''

Generate INCA/CANape extensions

Enable real-time applications to generate data, such as A2L data, for Vector CANape® and ETAS® Inca.

Settings

Default: off

On

Enables real-time applications to generate data, such as that for A2L, for Vector CANape and ETAS Inca.

Off

Does not enable real-time applications to generate data, such as that for A2L, for Vector CANape and ETAS Inca.

Command-Line Information

Parameter: GenerateASAP2
Type: character vector
Value: 'on' | 'off'
Default: 'off'

See Also

Prepare ASAP2 Data Description File

Enable Stateflow animation

Enables visualization of Stateflow® chart animation.

Settings

Default: off

On

Enables visualization of Stateflow chart animation.

Off

Disables visualization of Stateflow chart animation.

Command-Line Information

Parameter: xPCEnableSFAnimation
Type: character vector
Value: 'on' | 'off'
Default: 'off'

See Also

Animate Stateflow Charts with Simulink External Mode

Was this topic helpful?