Products & Services Solutions Academia Support User Community Company

Learn more about Data Acquisition Toolbox   

Creating an Analog Input Object

You create an analog input object with the analoginput function. analoginput accepts the adaptor name and the hardware device ID as input arguments. For a list of supported adaptors, refer to Hardware Driver Adaptor. The device ID refers to the number associated with your board when it is installed. (When using NI-DAQmx, this is usually a string such as 'Dev1'.) Some vendors refer to the device ID as the device number or the board number. The device ID is optional for sound cards with an ID of 0. Use the daqhwinfo function to determine the available adaptors and device IDs. If you do not see your adaptor in the list of available adaptors, refer to Troubleshooting Your Hardware.

Each analog input object is associated with one board and one analog input subsystem. For example, to create an analog input object associated with a National Instruments board with device ID 1:

ai = analoginput('nidaq','Dev1');

The analog input object ai now exists in the MATLAB workspace. You can display the class of ai with the whos command.

whos ai
  Name      Size         Bytes  Class

  ai        1x1           1332  analoginput object

Grand total is 52 elements using 1332 bytes

Once the analog input object is created, the properties listed below are automatically assigned values. These general purpose properties provide descriptive information about the object based on its class type and adaptor.

Table 4-1. Descriptive Analog Input Properties

Property Name

Description

Name

Specify a descriptive name for the device object.

Type

Indicate the device object type.

You can display the values of these properties for ai with the get function.

get(ai,{'Name','Type'})
ans = 
    'nidaqmxDev1-AI'    'Analog Input'
  


Recommended Products

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

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