| Data Acquisition Toolbox™ | ![]() |
Return device objects, channels, or lines from data acquisition engine to MATLAB® workspace
out = daqfind
out = daqfind('PropertyName',PropertyValue,...)
out = daqfind(S)
out = daqfind(obj,'PropertyName',PropertyValue,...)
'PropertyName' | A device object, channel, or line property name. |
PropertyValue | A device object, channel, or line property value. |
obj | A device object, array of device objects, channels, or lines. |
S | A structure with field names that are property names and field values that are property values. |
out | An array or cell array of device objects, channels, or lines. |
out = daqfind returns all device objects that exist in the data acquisition engine. The output out is an array.
out = daqfind('PropertyName',PropertyValue,...) returns all device objects, channels, or lines that exist in the data acquisition engine and have the specified property names and property values. The property name/property value pairs can be specified as a cell array.
out = daqfind(S) returns all device objects, channels, or lines that exist in the data acquisition and have the property names and property values specified by S. S is a structure with field names that are property names and field values that are property values.
out = daqfind(obj,'PropertyName',PropertyValue,...) returns all device objects, channels, or lines listed by obj that have the specified property names and property values.
daqfind is particularly useful in these circumstances:
A device object is cleared from the MATLAB workspace, and it needs to be retrieved from the data acquisition engine.
You need to locate device objects, channels, or lines that have particular property names and property values.
You can use property name/property value string pairs, structures, and cell array pairs in the same call to daqfind. However, in a single call to daqfind, you can specify only device object properties or channel/line properties.
You must use the same format as returned by get. For example, if get returns the ChannelName property value as Left, you must specify Left as the property value in daqfind (case matters). However, case does not matter when you specify enumerated property values. For example, daqfind will find a device object with a Running property value of On or on.
You can use daqfind to return a cleared device object.
ai = analoginput('winsound');
ch = addchannel(ai,1:2);
set(ch,{'ChannelName'},{'Joe';'Jack'})
clear ai
ainew = daqfind;To return the channel associated with the descriptive name Jack:
ch2 = daqfind(ainew,'ChannelName','Jack');
To return the device object with a sampling rate of 8000 Hz and the descriptive name winsound0-AI, you can pass a structure to daqfind.
S.Name = 'winsound0-AI'; S.SampleRate = 8000; daqobj = daqfind(S);
![]() | daqcallback | daqhelp | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |