Data Transfer Representation and Processing - MATLAB & Simulink (original) (raw)

Main Content

What Is a Data Transfer?

A data transfer occurs between blocks that represent callable functions and exchange data over a signal line. The representation of a data transfer in a model depends on whether the model is a rate-based model or an export-function model. If the model is rate based, whether the connected blocks use the same sample rate. Single-rate data transfers and data transfers between exported functions are represented as a signal line that connects the functions.

This figure shows a single-rate data transfer between function-call subsystems. Both function-call subsystems are configured to use a sample rate of 1.0 seconds.

Multirate data transfers are data transfers between function blocks that are configured to use different sample rates. You represent a data transfer in a model by configuring Simulink® to automatically insert a Rate Transition block or by inserting the block manually on the signal line that connects the function blocks.

This figure shows a multirate data transfer between function-call subsystems. One function-call subsystem is configured to use a sample rate of 1.0 seconds and the other function-call subsystem is configured to use a sample rate of 2.0 seconds.

Data Transfer Considerations

When designing a multirate model, for each data transfer consider the importance of:

Data Integrity

The data integrity of a data transfer concerns the accuracy, consistency, and completeness of data during transfer and processing. Data integrity can be compromised when the input to a block changes during the execution of the block and when preemption occurs.

Consider this sample scenario:

This type of data transfer is unprotected. For a description of unprotected data transfers, see Fast-to-Slow Periodic Rate Transitions During Generated Code Execution.

For a protected data transfer, the output _V_1 of the faster block is held until the slower block finishes executing.

Determinism

A data transfer is deterministic if the timing of the transfer is completely predictable given:

Latency

Latency of a data transfer is the time delay that results from the data being transferred to reach the receiving block. Depending on your application requirements, you might need to favor minimizing data transfer latency over data integrity and determinism.

Memory Usage

Depending on your application requirements, you might need to favor minimizing memory usage for data transfers over data integrity and determinism.

Code Generation Data Transfer Assumptions

When producing code for data transfers between functions, the code generator makes these assumptions:

Make sure that your model, code, and target environment align with these assumptions.

Data Transfer Limitations

See Also

Topics