| Data Acquisition Toolbox | Search  Help Desk |
Creating an Analog Output Object
Before executing an analog output (AO) task, you must create an analog output object.AO = analogoutput('adaptor', ID);
analogoutput is the analog output object creation function.
adaptor is the hardware driver adaptor name.
ID is the vendor-specific device label.
AO is the analog output object.
Name property.
By default, no hardware channels are associated with a newly created analog output object. To associate channels with the device object, you must use the addchannel function.
Example: Create an Analog Output Object
Suppose you want to create the analog output objectAO for a sound card. Since there is no device label for the sound card, the analog output object creation function requires only the adaptor name as an argument.
AO = analogoutput('winsound');
AO now exists in the MATLAB workspace and the engine. You can display the device object's name using
get(AO, 'Name')
ans =
winsound0-AO
You cannot yet use AO to output data since it has no hardware channels associated with it. Additionally, you must set property values to establish the required behavior for your specific application. Adding channels to an analog output object is described below.