Output single sample to multiple analog channels 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 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's execution. The block outputs a single sample every sample time, synchronously to the hardware, during the model's run time.
Note: You need a license for both Data Acquisition Toolbox and Simulink software to use this block.
The block has one or more input ports, depending on the option you choose in the Sink Block Parameters dialog box. It has no output ports. The following diagram shows the block configured with one port for both channels and with one port for each channel, in the case of a device that has two channels selected.
Note: You can use Analog Output (Single Sample) block only with devices that support single sample output. The block will error out when the model is run with a device that does not support single sample acquisition. To send data using devices that do not support acquisition of a single sample (like devices designed for sound and vibration), use the Analog Output block.
The Analog Output (Single Sample) block inherits the sample time from the driving block connected to the input port. The valid data type of the signal at the input port is double.
The Analog Output (Single Sample) 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 Analog Output (Single Sample) 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.
Use the Sink Block Parameters dialog box to select your device and to set other 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 channel configuration table lists your device's hardware channels and lets you configure them. Use the check boxes and selection buttons to specify which channels to acquire data from. These parameters are specified for each selected channel:
Hardware Channel — Displays the hardware channel ID specified by the device. The Hardware Channel column is read-only and the parameters are defined when the device is selected.
Name — Specifies the channel name.
By default the table will display any names provided by the hardware,
but you can edit the names. For example, if you are sending data and
trigger signals to an output device, you can name them
Output Range — Specifies the output ranges available for each channel supported by the hardware, and the available values are defined when a device is selected.
Select 1 for all hardware channels (default) or 1 per hardware channel.
Using 1 for all hardware channels, receives data from a single port as a matrix, with a size of [Block size x Number of Channels selected].
Using 1 per hardware channel, receives
data from N ports, where N is equal to the number of selected channels.
Each input port will be a scalar. For naming, each output port will
use the channel name if one was specified, or otherwise use ["HWChannel"
+ channel ID], for example,