Real-Time Workshop User's Guide    

Overview

The core of a Real-Time Workshop Embedded Coder program is typically the main loop. On each iteration, the main loop executes a background or null task and checks for a termination condition.

The main loop is periodically interrupted by a timer. The Real-Time Workshop function rt_OneStep is either installed as a timer ISR, or called from a timer ISR at each clock step.

The execution driver, rt_OneStep, sequences calls to the model_step function. The operation of rt_OneStep differs depending on whether the generating model is single-rate or multirate. In a single-rate model, rt_OneStep simply calls the model_step function. In a multirate model, rt_OneStep prioritizes and schedules execution of blocks according to the rates at which they run.

If your model includes device driver blocks, the model_step function will incorporate your in-lined driver code to perform I/O functions such as reading inputs from an analog-digital converter (ADC) or writing computed outputs to a digital-analog converter (DAC).


 Program Execution Main Program