Main Content

Analog Output (Single Sample)

Output single sample to multiple analog channels of data acquisition device

  • Library:
  • Data Acquisition Toolbox

  • Analog Output (Single Sample) block


The Analog Output (Single Sample) 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. The block outputs a single sample every time step, synchronously to the hardware, during the model run time.

The block has one or more input ports, depending on the option you choose in its dialog box. It has no output ports. The valid data type of the signal at the input port is double.

The Analog Output (Single Sample) block inherits the sample time from the driving block connected to the input port. Analog output is done synchronously, according to the following diagram.

Timing of synchronous analog output

At the first time step (T1), data is output to the selected hardware channels. The simulation does not continue until data is output to all channels.



You can use the Analog Output (Single Sample) block only with devices that support single sample output. To send data using devices that do not support acquisition of a single sample (such as devices designed for sound and vibration), use the Analog Output block.


Other Supported Features



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



expand all

Analog output to generate, specified as doubles. If using only one input port for all channels, provide a 1-by-N vector for a single scan on all N channels.

If using a port for each channel, provide a double value to each port. Multiple ports are named by channel names or device specified channel IDs.

Data Types: double


expand all








Number of input data ports, specified as:

1 for all channels (default) — One input port on the block provides data for all channels. Provide data as a 1-by-N vector for N channels.

1 per channel — N input ports on the block, where N is equal to the number of selected channels. Provide data as a double value to each port. For naming, each output port uses the channel name if one was specified, otherwise the channel ID, for example, ao1.

Block sample time, specifies the sample time of the block during the simulation. This is the rate at which the block is executed during simulation. The default value is 1. For more information, see What Is Sample Time? (Simulink).

Introduced in R2016b