| Data Acquisition Toolbox™ | ![]() |
AI = analoginput('adaptor')
AI = analoginput('adaptor',ID)'adaptor' | The hardware driver adaptor name. The supported adaptors are advantech, hpe1432, keithley, 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. |
AI | The analog input object. |
AI = analoginput('adaptor') creates the analog input object AI for a sound card having an ID of 0 (adaptor must be winsound). This is the only case where ID is not required.
AI = analoginput('adaptor',ID) creates the analog input object AI for the specified adaptor and for the hardware device with device identifier ID. ID can be specified as an integer or a string.
When an analog input object is created, it does not contain any hardware channels. To execute the device object, hardware channels must be added with the addchannel function.
You can create multiple analog input objects that are associated with a particular analog input subsystem. However, you can typically execute only one object at a time.
The analog input object exists in the data acquisition engine and in the MATLAB® workspace. If you create a copy of the device object, it references the original device object in the engine.
If ID is a numeric value, then you can specify it as an integer or a string. If ID contains any nonnumeric characters, then you must specify it as a string (see the Agilent Technologies® example below).
The Name property is automatically assigned a descriptive name that is produced by concatenating adaptor, ID, and -AI. You can change this name at any time.
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 while Agilent Technologies refers to it is as the device ID.
For sound cards, the device identifier is typically not exposed to you through the Microsoft® Windows® environment. However, the Data Acquisition Toolbox™ software automatically associates each sound card with an integer ID value. There are two cases to consider:
If you have one sound card installed, then ID is 0. You are not required to specify ID when creating an analog input object associated with this device.
If you have multiple sound cards installed, the first one installed has an ID of 0, the second one installed has an ID of 1, and so on. You must specify ID when creating analog input objects associated with devices not having an ID of 0.
There are two ways you can determine the ID for a particular device:
Type daqhwinfo('adaptor').
Execute the vendor-supplied device configuration utility.
To create an analog input object for a National Instruments board defined as device number 1:
AI = analoginput('nidaq','Dev1');To create an analog input object for an Agilent Technologies module with device identifier 1 residing in VXI chassis 0:
AI = analoginput('hpe1432','vxi0::1::instr');Alternatively, you can use the syntax
AI = analoginput('hpe1432',1,0);The HP driver allows you to span multiple hardware devices. To create an analog input object that spans two HP devices with device identifiers 1 and 2 residing in VXI chassis 0:
AI = analoginput('hpe1432','vxi0::1,2::instr');Alternatively, you can use the syntax
AI = analoginput('hpe1432',[1,2],0);![]() | addmuxchannel | analogoutput | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |