Skip to Main Content Skip to Search
Product Documentation

analogoutput - Create analog output object

Syntax

AO = analogoutput('adaptor')
AO = analogoutput('adaptor',ID)

Arguments

'adaptor'

The hardware driver adaptor name. The supported adaptors are advantech, mcc, nidaq, and winsound.

ID

The hardware device identifier. ID is optional if the device object is associated with a sound card having an ID of 0.

AO

The analog output object.

Description

AO = analogoutput('adaptor') creates the analog output object AO for a sound card having an ID of 0 (adaptor must be winsound). This is the only case where ID is not required.

AO = analogoutput('adaptor',ID) creates the analog output object AO for the specified adaptor and for the hardware device with device identifier ID. ID can be specified as an integer or a string.

Tips

More About Creating Analog Output Objects

More About the Hardware Device Identifier

When data acquisition devices are installed, they are assigned a unique number which identifies the device in software. The device identifier is typically assigned automatically and can usually be manually changed using a vendor-supplied device configuration utility. National Instruments refers to this number as the device number.

For sound cards, the device identifier is typically not exposed to you through the Microsoft Windows environment. However, Data Acquisition Toolbox software automatically associates each sound card with an integer ID value. There are two cases to consider:

There are two ways you can determine the ID for a particular device:

Properties

Basic Setup Properties

SampleRateSpecify per-channel rate at which analog data is converted to digital data, or vice versa
TriggerTypeSpecify type of trigger to execute

Channel Properties

ChannelNameSpecify descriptive channel name
DefaultChannelValueSpecify value held by analog output subsystem
HwChannelSpecify hardware channel ID
IndexMATLAB index of hardware channel or line
NativeOffsetIndicate offset to use when converting between native data format and doubles
NativeScalingIndicate scaling to use when converting between native data format and doubles
OutputRangeSpecify range of analog output hardware subsystem
ParentIndicate parent (device object) of channel or line
TypeIndicate device object type, channel, or line
UnitsSpecify engineering units label
UnitsRangeSpecify range of data as engineering units

Trigger Properties

InitialTriggerTimeAbsolute time of first trigger
TriggerFcnSpecify callback function to execute when trigger occurs
TriggersExecutedIndicate number of triggers that execute
TriggerTypeSpecify type of trigger to execute

Status Properties

RunningIndicate whether device object is running
SamplesAvailableIndicate number of samples available per channel in engine
SamplesOutputIndicate number of samples output per channel from engine
SendingIndicate whether data is being sent to hardware device

Hardware Configuration Properties

ClockSourceSpecify clock that governs hardware conversion rate
SampleRateSpecify per-channel rate at which analog data is converted to digital data, or vice versa

Data Management Properties

MaxSamplesQueuedIndicate maximum number of samples that can be queued in engine
RepeatOutputSpecify number of additional times queued data is output
TimeoutSpecify additional waiting time to extract or queue data

Callback Properties

RuntimeErrorFcnSpecify callback function to execute when run-time error occurs
SamplesOutputFcnSpecify callback function to execute when predefined number of samples is output for each channel group member
SamplesOutputFcnCountSpecify number of samples to output for each channel group member before samples output event is generated
StartFcnSpecify callback function to execute before device object runs
StopFcnSpecify callback function to execute after device object runs
TimerFcnSpecify callback function to execute when predefined time period passes
TimerPeriodSpecify time period between timer events
TriggerFcnSpecify callback function to execute when trigger occurs

General Purpose Properties

BufferingConfigSpecify per-channel allocated memory
BufferingModeSpecify how memory is allocated
ChannelContain hardware channels added to device object
EventLogStore information for specific events
NameSpecify descriptive name for the channel
OutOfDataModeSpecify how value held by analog output subsystem is determined
TagSpecify device object label
TypeIndicate device object type, channel, or line
UserDataStore data to associate with device object

Examples

National Instruments

To create an analog output object for a National Instruments device defined as 'Dev1':

AO = analogoutput('nidaq','Dev1');

To create an analog output object for a Measurement Computing device defined as '1':

AO = analogoutput('mcc','1');

See Also

addchannel | daqhwinfo | Name

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS