MATLAB Examples

Real-Time Signal Generator

This example shows how to produce an analog output signal using Simulink Desktop Real-Time™. Because analog output typically requires less configuration and is easier to connect than analog input, this model is a good start to your experiments with data acquisition boards. You can verify the presence of the generated signal e.g. by connecting an oscilloscope to the analog output pins of your data acquisition board.

Note: To run this model, you must have a data acquisition board connected to your computer.

Contents

How to run this model in Normal Mode

  1. Open the Analog Output block and select your data acquisition board. If there's no board installed, install it using the Install new board button.
  2. Double-click the orange button to switch to Normal Mode if needed.
  3. Start the real-time execution using Simulation->Run.

How to run this model in External Mode

  1. Open the Analog Output block and select your data acquisition board. If there's no board installed, install it using the Install new board button.
  2. Double-click the orange button to switch to External Mode if needed.
  3. Start the real-time execution using Simulation->Run. The model will automatically build, connect to Simulink in External Mode and start.

Open the model

open_system(fullfile(matlabroot,'toolbox','sldrt','sldrtexamples','sldrtex_siggen'));

Close open Scopes

close_system(find_system(gcs ,'BlockType', 'Scope'));

Clean up

clear
close all
bdclose all

See Also