Data Acquisition Toolbox
  Function/Property:
    Search    Help Desk 

Creating an Analog Input Object

Before executing an analog input (AI) task, an analog input object must be created. You create an AI object with the command

where:

The valid device object creation function arguments are given below.

Table 3-1: Analog Input Object Creation Function Argument Values
Value
Description
Supported Drivers
Sound Cards
NI
HP VXI
adaptor
Adaptor name
winsound
nidaq
hpvxi
ID
Device label
N/A
Device number
Device id

If the hardware driver adaptor has been successfully registered by the data acquisition engine, then an analog input object can be created. Once the device object is created, then:

By default, no hardware channels are associated with a newly created analog input object. To associate channels with the device object, the addchannel function must be used.

Example: Create an Analog Input Object

Suppose you want to create the analog input object AI for a sound card. Since there is no device label for the sound card, the analog input object creation function requires only the adaptor name as an argument.

An analog input object called AI now exists in the MATLAB workspace and the engine. The device object's name can now be displayed.

If you are familiar with Handle Graphics®, then AI may look like a handle to you. In fact, it is not a handle but a Data Acquisition Toolbox object. To verify this, type whos AI at the command line.

AI cannot yet be used to acquire data since it has no hardware channels associated with it. Additionally, property values must be set to establish the required behavior for your specific application.



[ Previous | Help Desk | Next ]