function [adaptorsWithDevices, deviceNames]=findInstalledDevices() %% Identifying Available Devices names and adaptors %% Identifying Installed Adaptors % The |imaqInfoHW| function provides a structure with an % |InstalledAdaptors| field that lists all adaptors on the current system % that the toolbox can access. AdaptorsInfo = imaqhwinfo; % AdaptorsInfo.InstalledAdaptors nAdaptors = length(AdaptorsInfo.InstalledAdaptors); isAdaptorWithDevice=true(1,nAdaptors); deviceNames={}; for iAdaptor=1:nAdaptors %% Obtaining Device Information % Calling |imaqInfoHW| with an adaptor name returns a structure that provides % information on all accessible image acquisition devices. InfoHW = imaqhwinfo(AdaptorsInfo.InstalledAdaptors{iAdaptor}); if isempty(InfoHW.DeviceInfo) isAdaptorWithDevice(iAdaptor)=false; else nDevice=length(InfoHW.DeviceInfo); for iDevice=1:nDevice deviceNames=cat(2, deviceNames, InfoHW.DeviceInfo(iDevice).DeviceName); end end end adaptorsWithDevices=AdaptorsInfo.InstalledAdaptors(isAdaptorWithDevice);