Real-Time Data Exchange via RTDX™
This example shows how to use the From RTDX and To RTDX blocks to send data from host to target and receive data from target to host. The model implements a simple sine wave generator that runs on the F28335 board.
NOTE: The Real-Time Data Exchange via RTDX™ supports only Code Composer Studio v3.3.
Required Hardware:
- Spectrum Digital F2808 eZdsp
- Spectrum Digital F2812 eZdsp
- Spectrum Digital F28044 eZdsp
- Spectrum Digital F28335 eZdsp
- Texas Instruments™ F2808/F28027/F28035/F28069/F28335/F28343/F28346 ControlCARD with docking station
- Texas Instruments™ F28027/F28069 ControlSTICK
Available versions of this example:
This example can be run on all boards by changing the processor selection of the model: c28x_rtdxtest.mdl
Contents
Model
The following figure shows the example model.
Description
The first step to run this example is to generate code for the model and to build it to run on the target. Once the model is running, we use a MATLAB® script to read the sine wave values from the channel specified by the "To RTDX" block and plot them. To change the frequency and amplitude of the sine wave while it is running on the target, we use the same MATLAB script to write data to the channels specified by the "From RTDX" blocks. Note that the RTDX™ channel names specified in the RTDX blocks in the Simulink® model are the same channel names used in the MATLAB script. Open the example script to see the specific MATLAB code used to establish RTDX communication.
How to Run the Example
- Open the model c28x_rtdxtest.mdl.
- The model is configured by default for the F28335 processor. Open the Model Configuration Parameters dialog and select "Coder Target" under "Code Generation". Next, click "Target Hardware Resources" dialog to select a different processor.
- Click OK to save the changes.
- Click Build/Reload & Run to generate, build, load and run the program.