Main Content

Configure Data Transfer Settings Between Concurrent Tasks

Data dependencies arise when a signal originates from one block in one partition and is connected to a block in another partition. To create opportunities for parallelism, Simulink® provides multiple options for handling data transfers between concurrently executing partitions. These options help you trade off computational latency for numerical signal delays. This topic describes how to configure data transfer settings between partitions operating at the same rate.

To configure data transfer between partitions operating at different rates, manually add Rate Transition blocks or select Automatically handle rate transition for data transfer in the Configuration Parameters to enable automatic insertion of Rate Transition blocks.

Specify Data Transfer Options for Concurrently Executing Partitions

Use Data Transfer parameters in the Concurrent Execution tool to define communications between tasks. If you select the Use global setting option for any data transfer parameters, set the values in the Data Transfer tab of the Signal Properties dialog box. You can override options set in the Concurrent Execution tool by setting options in the Data Transfer pane of the Signal Properties dialog box.

The data transfer configuration depends on how you want your tasks to communicate and the desired trade off between computational latency and numerical signal delays. The table provides the model-level options that you can apply to each signal that requires data transfer in the system.

Data Transfer Options

GoalData Transfer TypeSimulationDeployment
  • Create opportunity for parallelism.

  • Reduce signal latency.

Ensure data integrity only

Data transfer is simulated using a one-step delay.

Simulink Coder™ ensures data integrity during data transfer. Simulink generates code to operate with maximum responsiveness and data integrity. However, the implementation is interruptible, which can lead to loss of data during data transfer.

Use a deterministic execution schedule to achieve determinism in the deployment environment.

  • Create opportunity for parallelism.

  • Produce numeric results that are repeatable with each run of the generated code.

Ensure deterministic transfer (maximum delay)

Data transfer is simulated using a one-step delay, which can have impact on the numeric results. To compensate, you might need to specify an initial condition for these delay elements.

Simulink Coder ensures data integrity during data transfer. In addition, Simulink Coder ensures that data transfer is identical with simulation.
  • Enforce data dependency.

  • Produce numeric results that are repeatable with each run of the generated code.

Ensure deterministic transfer (minimum delay)

Data transfer occurs within the same step.

Use the Data Transfer Options table to determine how you want your tasks to communicate and select defaults for periodic and continuous signals in the Data Transfer pane of the Concurrent Execution tool. You can also select an extrapolation method for continuous signals. Simulink uses extrapolation methods to compensate for numerical errors that were introduced due to delays and discontinuities in data transfer.

Concurrent Execution tool with Data Transfer parameters open.

For example, consider a control application in which a controller that reads sensory data at time T must produce the control signals to the actuator at time T+Δ. Based on the Data Transfer Options table, you may consider using:

  • Ensure deterministic transfer (minimum delay), if the sequential algorithm meets the timing deadlines.

  • Ensure deterministic transfer (maximum delay), if the embedded system provides deterministic scheduling.

  • Ensure data integrity only to create opportunities for parallelism by introducing signal delays.

Set Initial Conditions

To avoid numerical errors in signals configured for Ensure Data Integrity Only and Ensure deterministic transfer (maximum delay) data transfers, you may need to provide an initial condition.

You can specify the initial condition in the Data Transfer tab of the Signal Properties dialog box. To access this dialog box, right-click the signal line and select Properties from the context menu.

Signal Properties dialog box with the Data Transfer tab open.

You can specify the initial input on the reader side of the data transfer using the initial condition parameter.

  • For discrete signals, the initial condition is applied for Ensure data integrity only and Ensure deterministic transfer (maximum delay) data transfer types.

  • For continuous signals, the initial condition is used by the extrapolation method and is applied for: Ensure deterministic transfer (maximum delay) data transfer type.

Simulink does not allow the initial condition value to be Inf or NaN.

Related Topics