Engee documentation

Rate Transition

Controls data transfer between blocks operating at different rates (sampling rates).

blockType: RateTransition

Path in the library:

/Basic/Signal Attributes/Rate Transition

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. Correctly setting the parameters of the block allows you to find a balance between data integrity and transmission determinism on the one hand, and higher performance or memory savings on the other hand.

Processing parameters

Processing parameters Block parameters settings
  • Data integrity

  • Deterministic data transmission

  • Maximum delay

Enabled:

  • Ensure data integrity during data transfer

  • Ensure deterministic during data (maximum delay)

  • Data integrity

  • Non-deterministic data transmission

  • Minimal latency

  • Higher memory requirements

Enabled:

  • Ensure data integrity during data transfer

Not Included:

  • Ensure deterministic during data (maximum delay)

  • Possible loss of data integrity

  • Non-deterministic data transmission

  • Minimal latency

  • Lower memory requirements

Not included:

  • Ensure data integrity during data transfer

  • Ensure deterministic during data (maximum delay)

Dependencies

The behaviour of the Rate Transition block depends on the following conditions:

  • Calculation steps of the ports to which the block connects;

  • Task priorities for the source and target calculation steps;

  • Whether a fixed or variable step solver is used.

Ports

Input

# IN_1 — input signal
scalar | vector | matrix | N-dimensional array | bus

Details

_ Description missing._

Data types

Float64.

Complex numbers support

Yes

Output

# OUT_1 — output signal
scalar | vector | matrix | N-dimensional array | bus

Details

The input signal is converted to an output signal at the specified sampling rate. The configuration by default provides secure and deterministic data transmission.

Data types

Int8, Uint8, Int16, UInt16, Int32, UInt32, Int64, UInt64, Int128, UInt128, Float16, Float32, Float64, Bool, Fixed-point, BusSignal.

Complex numbers support

Yes

Parameters

Main

# Ensure data integrity during data transfer — ensure data integrity
Logical

Details

Checking this box will generate a code to ensure data integrity when the data is transmitted by the block. If this parameter is enabled and the transmission is non-deterministic, then, depending on the priority of the input or output rate, the generated code will use one or more buffers to protect data integrity during transmission.

Otherwise, the Rate Transition block is either ignored or generates code that uses a copy operation to affect data transmission. This unprotected mode consumes less memory. But the copy operation can be interrupted, which can cause loss of data integrity during transmission. Enable this parameter to make the generated code run at maximum speed (i.e. non-deterministic) and preserve data integrity.

Default value

true (switched on)

Program usage name

Integrity

Tunable

No

Evaluatable

No

# Ensure deterministic during data (maximum delay) — ensure deterministic data transfer
Logical

Details

Checking this box results in code that transmits data at the sampling rate of the slower block, i.e. deterministically. If this checkbox is not selected, data transmission occurs when new data is available from the source block and the receiving block is ready to receive the data. In this way, transfer delays are eliminated, thereby ensuring that the system operates at maximum responsiveness. However, transfers can occur unpredictably, which is undesirable in some applications.

Dependencies

To use this parameter, select the check box Ensure data integrity during data transfer.

Default value

true (switched on)

Program usage name

Deterministic

Tunable

No

Evaluatable

No

# Initial conditions — initial value

Details

This parameter applies only to transitions from a slow block to a fast block. It sets the output value of the Rate Transition block at the beginning of the transition when there is no output signal due to no input signal coming from the slow block connected to the input of the Rate Transition block.

The set value must be a scalar or have the same dimensions as the input signal.

Dependencies

To use this parameter, select the check box Ensure data integrity during data transfer.

Default value

0

Program usage name

InitialCondition

Tunable

No

Evaluatable

Yes

# Output port sample time options — method of setting the output port calculation step
Specify | Inherit | Multiple of input port sample time

Details

Specifies the method for setting the output port calculation step. Options:

  • Specify - use the parameters Output port sample time. to explicitly set the output sampling rate.

  • Inherit - inherit the calculation step from the block to which the output port is connected.

  • Multiple of input port sample time - set the output speed of the block Rate Transition as a multiple of its input speed (parameters Sample time multiple (>0)).

If you select Inherit and all blocks connected to the output port also inherit the calculation step, the fastest calculation step in the model is applied.

Values

Specify | Inherit | Multiple of input port sample time

Default value

Specify

Program usage name

OutPortSampleTimeOpt

Tunable

No

Evaluatable

No

# Output port sample time — output port calculation step
Real number

Details

Enter the calculation step value for the output port.

A value by default (-1) indicates that the Rate Transition unit inherits the output speed from the unit to which the output port is connected.

Dependencies

To use this parameter, set the Output port sample time options parameters to Specify.

Default value

-1

Program usage name

OutPortSampleTime

Tunable

No

Evaluatable

Yes

# Sample time multiple (>0) — calculation step multiplier
Real number

Details

A positive value that sets the calculation step of the output signal to a multiple of the input signal frequency.

A value by default (1) indicates that the output rate is the same as the input rate. A value of 0.5 indicates that the output rate is half the input rate. A value of 2 indicates that the output speed is twice the input speed.

Dependencies

To use this parameter, set the parameter Output port sample time options to the value of Multiple of input port sample time.

Default value

1

Program usage name

OutPortSampleTimeMultiple

Tunable

No

Evaluatable

Yes

Additional options

C code generation: Yes