Digital Output

Output data to multiple digital lines of data acquisition device


Data Acquisition Toolbox™

    Note:   You cannot use certain devices with Data Acquisition Toolbox Simulink® blocks. Refer to the Supported Hardware page to see if your device supports Simulink use.


The Digital Output block synchronously outputs the latest set of data to the hardware at each simulation time step. It outputs unbuffered digital data. The output data is always a binary vector (binvec).

    Note:   You need a license for both Data Acquisition Toolbox and Simulink software to use this block.

The block has no output ports. It can have one or more input ports, depending on the option you choose in the Sink Block Parameters dialog box. The following diagram shows the block configured with one port for all lines and with one port for each line, in the case of a device that has 12 lines selected.

The Digital Output block inherits the sample time from the driving block connected to the input port. The data type of the signal at the input port must be a logical data type.

Digital output is done synchronously. The following diagram shows synchronous digital output.

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

Other Supported Features

The Digital Output block supports the use of Simulink Accelerator™ mode. This feature speeds up the execution of Simulink models.

    Note:   You need the C++ Compiler to use Simulink Accelerator mode.

The block supports the use of model referencing. This feature lets your model include other Simulink models as modular components.

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

Dialog Box

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


The data acquisition device to which you want to output 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 name of the device. The first available device is selected by default.


The line configuration table lists your device's lines and lets you configure them. Use the check boxes and selection buttons to specify which lines to send data to.

Hardware Port ID

Specifies the ID for each hardware port. This is automatically detected and filled in by the selected device, and is read only.

Hardware Line ID

Specifies the ID of the hardware line. This is automatically detected and filled in by the selected device, and is read only.


Specifies the hardware line name. This is automatically detected and filled in by the selected device, though you can edit the name.

Number of ports

Select 1 for all hardware lines (default) or 1 per hardware line.

Using 1 for all hardware lines means that the block will have only one input port for all lines selected in the table. Data needs to be [S x number of lines], where S is the number of samples. Data at the input port needs to be a binary vector (binvec).

Using 1 per hardware line means the block will have one input port per selected line. The name of each input port is the name specified in the table for each line. If no name is provided, the name is "Port" + HwPort ID + Line + Line ID. For example, if line 2 of port 3 is selected, and you did not specify a name in the line table, Port3Line2 appears in the block. Data needs to be [1 x 1].

Was this topic helpful?