| Data Acquisition Toolbox | Search  Help Desk |
Accessing Individual Channels
As discussed in "Property Names and Property Values", the Data Acquisition Toolbox supports two basic types of properties for analog output objects: common properties and channel properties. Common properties apply to all channels contained by the device object while channel properties apply to individual channels.Channel contains all the channels associated with an analog output object as created with addchannel. Using Channel, you can access individual channels to:
set command
get command
Channel to configure channel properties is illustrated in "Data Range and Engineering Units".
Setting the Sampling Rate
The rate that data is output per channel is set with theSampleRate property. SampleRate must be specified as samples per second. For example, to set the sampling rate of your sound card to 44,100 samples per second (44.1 kHz)
set(ao, 'SampleRate', 44100);
SampleRate, you should find out the actual rate set by the hardware driver.
ActualRate = get(ao, 'SampleRate')
SampleRate is 8 kHz for most sound cards. For other hardware devices, the default value is supplied by the hardware driver.
Defining a Trigger
For analog output objects, a trigger is defined as an event that initiates sending (outputting) data to the D/A converter. The sending status is indicated by theSending property. When a trigger occurs, Sending is set to On.
Defining a trigger for an analog output object involves specifying the trigger type. Trigger types are specified with the TriggerType property. The valid TriggerType values that are supported for all hardware are given below.