Rate Transition
Handle transfer of data between blocks operating at different rates
Libraries:
Simulink /
Signal Attributes
HDL Coder /
Signal Attributes
Description
The Rate Transition block transfers data from the output of a block operating at one rate to the input of a block operating at a different rate. Use the block parameters to trade data integrity and deterministic transfer for faster response or lower memory requirements. To learn about data integrity and deterministic data transfer, see Data Transfer Problems (Simulink Coder).
Transition Handling Options
Transition Handling Options | Block Parameter Settings |
---|---|
| Select:
|
| Select:
Clear:
|
| Clear:
|
Dependencies
The behavior of the Rate Transition block depends on:
Sample times of the ports to which the block connects (see Effects of Synchronous Sample Times and Effects of Asynchronous Sample Times)
Priorities of the tasks for the source and destination sample times (see Sample time properties in the Simulink® documentation)
Whether the model specifies a fixed- or variable-step solver (see Compare Solvers in the Simulink documentation)
Setting of model configuration parameters Device vendor and Device type (see Effects of Device Configuration)
Block Labels
When you update your diagram, a label appears on the Rate Transition block to indicate simulation behavior.
Label | Block Behavior |
---|---|
ZOH
| Acts as a zero-order hold |
1/z
| Acts as a unit delay |
Buf
| Copies input to output under semaphore control |
Db_buf
| Copies input to output using double buffers |
3buf | Copies input to output using triple buffers |
Copy
| Unprotected copy of input to output |
NoOp
| Does nothing |
Mixed
| Expands to multiple blocks with different behaviors |
RT | Indicates data transfer between partitions when using the Schedule Editor. For more information on using the Schedule Editor, see Using the Schedule Editor. |
Memory | Indicates memory mode. The block is in memory mode when Ensure
deterministic data transfer (maximum delay) is
|
The block behavior label shows the method that ensures safe transfer of data between tasks operating at different rates. You can use the sample-time colors feature (see View Sample Time Information) to display the relative rates that the block bridges. Consider, for example, the following model:
Sample-time colors and the block behavior label show:
The Rate Transition block at the top of the diagram acts as a zero-order hold in a fast-to-slow transition.
The Rate Transition block at the bottom of the diagram acts as a unit delay in a slow-to-fast transition.
For more information, see Rate Transitions and Data Transfers (Simulink Coder).
Effects of Synchronous Sample Times
The following table summarizes how each label appears when the sample times of the input
and output ports (inTs
and outTs
) are periodic, or
synchronous.
Block Settings | Block Label | |||
---|---|---|---|---|
Rate Transition | Conditions for Rate Transition Block | With Data Integrity and Determinism | With Only Data Integrity | Without Data Integrity or Determinism |
(Equal) |
| None (error) |
|
|
|
|
| ||
| None (error) |
| ||
(Fast to slow) |
|
|
Buf
| |
| None (error) | |||
| None (error) |
Db_buf
| ||
| None (error) | |||
(Slow to fast) |
|
|
Db_buf
| |
| None (error) | |||
| None (error) | |||
| None (error) | |||
KEY
|
When you select the Block reduction parameter on the Configuration
Parameters dialog box, Copy
reduces to NoOp
. No code
generation occurs for a Rate Transition block with a NoOp
label. To prevent a block from being reduced when block reduction is on, add a test point to
the block output (see Configure Signals as Test Points in the Simulink documentation).
Effects of Asynchronous Sample Times
The following table summarizes how each label appears when the sample time of the input
or output port (inTs
or outTs
) is not periodic, or
asynchronous.
Block Settings | Block Label | |||
---|---|---|---|---|
With Data Integrity and Determinism | With Only Data Integrity | Without Data Integrity or Determinism | ||
|
|
|
| |
| None (error) |
| ||
KEY
|
Effects of Device Configuration
If the settings of model configuration parameters Device vendor and Device type specify hardware that supports atomic data load and store operations, the code generator optimizes the generated rate transition code when the target hardware supports atomic load and store operations for the data type of the signal being transferred. The code generator takes advantage of the hardware data load and store capability by replacing double-buffering code between asynchronous tasks with code that performs a single memory copy.
Examples
Ports
Input
Output
Parameters
Block Characteristics
Data Types |
|
Direct Feedthrough |
|
Multidimensional Signals |
|
Variable-Size Signals |
|
Zero-Crossing Detection |
|
Extended Capabilities
Version History
Introduced before R2006a