This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

Analog Output

Output data to multiple analog channels of data acquisition device


Data Acquisition Toolbox™


Some devices are not supported by the Simulink® blocks in Data Acquisition Toolbox. To see if your device supports Simulink, refer to Supported Hardware.


The Analog Output block opens, initializes, configures, and controls an analog data acquisition device. The opening, initialization, and configuration of the device occur once at the start of the model execution. During the model run time, the block outputs data to the hardware synchronously (outputs the block of data as it is provided). On every time step, the block performs a blocking synchronous write to the hardware, outputting the entire input data.

The block has one or more input ports, depending on the option you choose in its dialog box. It has no output ports.

The Analog Output block inherits the sample time from the driving block connected to the input port. The valid data types of the signal at the input port are double or native data types supported by the hardware.


To use this block, you need both Data Acquisition Toolbox and Simulink software.

You can use the Analog Output block only with devices that support clocked generation. To generate data using devices that do not support clocking, use the Analog Output (Single Sample) block.

Other Supported Features

  • This block supports the use of Simulink Accelerator™ mode, but not Rapid Accelerator or code generation.

  • The block supports the use of model referencing, so that your model can include other Simulink models as modular components.

For more information on these features, see the Simulink documentation.

Dialog Box

Use the Block Parameters dialog box to set the block configuration options.

The following diagram shows the timing of the synchronous analog output.

At the first time step (T1), data output is initiated and the corresponding block of data (B1) is output to the hardware. The simulation does not continue until B1 is output completely.


The device from which you want to generate data. The items in the list vary, depending on which devices you have connected to your system. Devices in the list are specified by adaptor/vendor name and unique device ID, followed by the model name of the device, for example, ni Dev1 (USB-6255). The first available device is selected by default. CompactDAQ chassis would be shown as a single device; vendor name, chassis ID, and chassis model would be shown in the list, for example, ni cDAQ2 (cDAQ-9172).


The channel configuration table lists your device hardware channels and lets you configure them. Specify these parameters for each selected channel:

Channel ID — Hardware channel ID specified by the device. The Channel ID column is read-only, and the parameters are defined when the device is selected.

Name — Channel name. By default the table displays any names provided by the hardware, but you can edit the names. For example, if the device is a sound card with two channels, you can name them Left and Right.

Module — Device ID the channel belongs to. The Module column is read-only. If a CompactDAQ chassis is selected, it shows the ID of the CompactDAQ module which the channel belongs to; otherwise it shows the ID of the device.

Measurement Type — Measurement type of the channel. This block supports only voltage measurement types. (For other measurement types, use a data acquisition session in MATLAB®.)

Output Range — Output ranges available for each channel supported by the hardware, defined when a device is selected.

Number of ports

1 for all channels (default) — One input port on the block for all channels. Provide data as a matrix, with a size of blocksize by number of channels.

1 per channel — N input ports on the block, where N is equal to the number of selected channels. Provide each port’s data as a column vector with a size of blocksize-by-1. For naming, each output port uses the channel name if one was specified, otherwise the channel ID, for example, ai0.

Output sample rate

The rate at which samples are output from Simulink to the device, in samples per second. This is the sampling rate for the hardware. The default is defined when a device is selected. The sample rate must be a positive real number within the range allowed for the selected hardware.

Introduced in R2016b

Was this topic helpful?