| Contents | Index |
AI = analoginput('adaptor')
AI = analoginput('adaptor',ID)
Note You cannot use the legacy interface on 64–bit MATLAB. Use the session-based interface to acquire and generate data. |
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.
Note The Traditional NI-DAQ adaptor will be deprecated in a future version of the toolbox. If you create a Data Acquisition Toolbox™ object for Traditional NI-DAQ adaptor beginning in R2008b, you will receive a warning stating that this adaptor will be removed in a future release. See the supported hardware page at www.mathworks.com/products/daq/supportedio.html for more information. |
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 National Instruments 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.
Notes When you create an analog input object, it consumes system resources. To avoid this issue, make sure that you do not create objects in a loop. If you must create objects in a loop, make sure you delete them within the loop. |
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 identifier as the device name.
For sound cards, the device identifier is typically not exposed to you through the Microsoft® Windows® environment. However, 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.
AI |
The analog input object. |
| SampleRate | Specify per-channel rate at which analog data is converted to digital data, or vice versa |
| SamplesPerTrigger | Specify number of samples to acquire for each channel group member for each trigger that occurs |
| TriggerType | Specify type of trigger to execute |
| ChannelName | Specify descriptive channel name |
| HwChannel | Specify hardware channel ID |
| HwLine | Specify hardware line ID |
| Index | MATLAB index of hardware channel or line |
| InputRange | Specify range of analog input subsystem |
| NativeOffset | Indicate offset to use when converting between native data format and doubles |
| NativeScaling | Indicate scaling to use when converting between native data format and doubles |
| Parent | Indicate parent (device object) of channel or line |
| SensorRange | Specify range of data expected from sensor |
| Type | Indicate device object type, channel, or line |
| Units | Specify engineering units label |
| UnitsRange | Specify range of data as engineering units |
| InitialTriggerTime | Absolute time of first trigger |
| ManualTriggerHwOn | Specify hardware device starts at manual trigger |
| TriggerChannel | Specify channel serving as trigger source |
| TriggerCondition | Specify condition that must be satisfied before trigger executes |
| TriggerConditionValue | Specify voltage value(s) that must be satisfied before trigger executes |
| TriggerDelay | Specify delay value for data logging |
| TriggerDelayUnits | Specify units in which trigger delay data is measured |
| TriggerFcn | Specify callback function to execute when trigger occurs |
| TriggerRepeat | Specify number of additional times trigger executes |
| TriggersExecuted | Indicate number of triggers that execute |
| TriggerType | Specify type of trigger to execute |
| LogFileName | Specify name of disk file information is logged to |
| Logging | Indicate whether data is being logged to memory or disk file |
| LoggingMode | Specify destination for acquired data |
| LogToDiskMode | Specify whether data, events, and hardware information are saved to one or more disk files |
| Logging | Indicate whether data is being logged to memory or disk file |
| Running | Indicate whether device object is running |
| SamplesAcquired | Indicate number of samples acquired per channel |
| SamplesAvailable | Indicate number of samples available per channel in engine |
| ChannelSkew | Specify time between consecutive scanned hardware channels |
| ChannelSkewMode | Specify how channel skew is determined |
| ClockSource | Specify clock that governs hardware conversion rate |
| InputType | Specify analog input hardware channel configuration |
| SampleRate | Specify per-channel rate at which analog data is converted to digital data, or vice versa |
| DataMissedFcn | Specify callback function to execute when data is missed |
| InputOverRangeFcn | Specify callback function to execute when acquired data exceeds valid hardware range |
| RuntimeErrorFcn | Specify callback function to execute when run-time error occurs |
| SamplesAcquired | Indicate number of samples acquired per channel |
| SamplesAcquiredFcn | Specify callback function to execute when predefined number of samples is acquired for each channel group member |
| SamplesAcquiredFcnCount | Specify number of samples to acquire for each channel group member before samples acquired event is generated |
| StartFcn | Specify callback function to execute before device object runs |
| StopFcn | Specify callback function to execute after device object runs |
| TimerFcn | Specify callback function to execute when predefined time period passes |
| TimerPeriod | Specify time period between timer events |
| TriggerFcn | Specify callback function to execute when trigger occurs |
| BufferingConfig | Specify per-channel allocated memory |
| BufferingMode | Specify how memory is allocated |
| Channel | Contain hardware channels added to device object |
| EventLog | Store information for specific events |
| Name | Specify descriptive name for the channel |
| Tag | Specify device object label |
| Timeout | Specify additional waiting time to extract or queue data |
| Type | Indicate device object type, channel, or line |
| UserData | Store data to associate with device object |
To create an analog input object for a National Instruments device defined as 'Dev1':
AI = analoginput('nidaq','Dev1');To create an analog input object for a Measurement Computing device defined as '1':
AI = analoginput('mcc','1');

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |