To Target

Send data to target computer


Simulink® Real-Time™ Library for Displays and Logging


This block behaves as a sink. The main purpose of this block is to write a new value to a specific parameter on the real-time application.

You can use the function SimulinkRealTime.utils.createInstrumentationModel to create an instrumentation model using the To Target and From Target blocks.

The To Target block runs as a non-real-time Simulink block on the development computer. It is asynchronous to the real-time model running on the target computer. If the To Target block receives continuously changing input, two parameter updates can be sent to the target computer before the next sample time of the real-time application. In this case, the real-time application only uses the last parameter value received. Conversely, it is also possible for one or more sample times to elapse on the target computer before the To Target block sends the next parameter value.

In either case, the To Target block only sends parameter values to the target computer when there is a change (for example, the input of the To Target block changes).


The use of To Target blocks requires a connection between the development and target computers. Without a connection, operations such as opening a model or copying these blocks take longer than normal.

Some notes on the To Target block behavior:

  • To highlight the Simulink model block referenced by a To Target block, double-click the block.

  • If the To Target block has not yet been configured, double-clicking the block does nothing.

  • To edit the To Target block parameters, right-click the block and select Mask Parameters.

Block Parameters

Target application name

The function SimulinkRealTime.utils.createInstrumentationModel automatically enters a name entry for this parameter. It is the same name as the Simulink model that Simulink Real-Time uses to build the real-time application.

Path to block in target application

The function SimulinkRealTime.utils.createInstrumentationModel automatically enters an entry for this parameter and uses it to access the block identifier.

Parameter name

The function SimulinkRealTime.utils.createInstrumentationModel automatically determines the entry for this parameter and enters it. Note that the parameter name might not match the label name for that parameter in the Block Parameters dialog box. For example, the label name for a gain block is Constant value, but the parameter name is Value.

Use default target PC

Selecting this option directs Simulink Coder™ to build and download the real-time application to the default target computer. This assumes that you configured a default target computer through the Simulink Real-Time Explorer (see PCI Bus Ethernet Setup or USB-to-Ethernet Setup if you have not). By default, this check box is selected.

Specify target name

If you deselect the Use default target PC check box, this field is displayed. Enter the name of the configured target computer.

Introduced in R2014a

Was this topic helpful?