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.
Use the Data Transfer Options pane to define
communications between tasks. Set the values for the Use
global setting
option of the Data Transfer tab in the
Signal Properties dialog box. The table provides the model-level options
that you can apply to each signal that requires data transfer in the
system.
Data Transfer Options
Goal | Data Transfer Type | Simulation | Deployment |
---|---|---|---|
| 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. |
| 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. |
| Ensure deterministic transfer (minimum delay). | Data transfer occurs within the same step. |
You can also override these options for each signal from the Data Transfer pane of the Signal Properties dialog box. For more information, see Data Transfer Options for Concurrent Execution.
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+Δ.
If the sequential algorithm meets the timing deadlines, consider using option 3.
If the embedded system provides deterministic scheduling, consider using option 2.
Otherwise, use option 1 to create opportunities for parallelism by introducing signal delays.
For continuous signals, Simulink uses extrapolation methods to compensate for numerical errors that were introduced due to delays and discontinuities in data transfer.
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 this 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.
A dialog box like the following is displayed.
From the Data Transfer Options table, determine how you want your tasks to communicate.
In the Concurrent Execution dialog box, select Data Transfer defaults and apply the settings from step 1.
Apply your changes.