User`s guide
Rapid Prototyping Program Framework
6-29
Model Execution
At each sample interval, the main program passes control to the model
execution function, which executes one step though the model. This step reads
inputs from the external hardware, calculates the model outputs, writes
outputs to the external hardware, and then updates the states.
The following diagram illustrates these steps.
Figure 6-7: Executing the Model
Note that this scheme writes the system outputs to the hardware before the
states are updated. Separating the state update from the output calculation
minimizes the time between the input and output operations.
Read system inputs
from A/D
Calculate system outputs
Write system outputs
to D/A
Calculate and update
discrete states
Calculate and update
continuous states
Increment time
Integration
Algorithm
Execute Model