Main Content

Real-Time Sync

Synchronize model execution to real time in Connected IO mode

  • Real-Time Sync block

Libraries:
Simulink Desktop Real-Time

Description

The Real-Time Sync block synchronizes your Simulink® model with the real-time kernel clock at Real-Time Sync block sample hits. The parameters specify only sample time and missed tick values. There are no input ports.

The Real-Time Sync block operates only in Connected IO mode. It has no function in Run in Kernel mode.

If the Connected IO mode model contains another Simulink Desktop Real-Time™ block, the other block synchronizes the Simulink model with the real-time clock. Do not include the Real-Time Sync block in such a model.

Examples

Ports

Output

expand all

In Connected IO mode, returns the number of timer ticks that your model lags behind the real-time kernel. When the model lags by more than Maximum missed ticks, the software reports an error and simulation stops.

Dependency

When you select Show “Missed Ticks” port, this port is visible.

Data Types: double

Parameters

expand all

Enter a value, in seconds, that represents how frequently you want the block to execute and interact with the I/O hardware. The block synchronizes your model with the real-time clock at this sample rate.

If you are using a fixed-step solver, enter the value that you entered as the Fixed step size configuration parameter or an integer multiple of that value.

Programmatic Use

Block Parameter: SampleTime

In Connected IO mode, enter the number of timer ticks that your model can lag behind the real-time kernel. When the model lags behind by this number or fewer timer ticks, the software assumes that the lag is temporary. It allows the model to catch up, even if the model misses some ticks. When the model lags by more than this number, the software reports an error and simulation stops.

In Run in Kernel mode, the software ignores this value.

Programmatic Use

Block Parameter: MaxMissedTicks

In Connected IO mode, select this check box to send the number of missed ticks to output port Missed Ticks.

In Run in Kernel mode, the Missed Ticks port is zero.

Programmatic Use

Block Parameter: ShowMissedTicks

In Connected IO mode, select this check box to grant other programs more CPU time while the kernel waits for a response from the hardware.

In Run in Kernel mode, the software ignores this value.

Programmatic Use

Block Parameter: YieldWhenWaiting

Version History

Introduced in R2012a

expand all

See Also