User`s guide
4 Connecting to Hardware
By default, the video input object makes the first video source object in the
array the selected source. To use another video source, change the value of
the
SelectedSourceName property.
This example changes the currently selected video source object from
CH0 to
CH1 by setting the value o f the SelectedSource Name property.
vid.SelectedSourceName = 'CH1';
Note The getselec ted source function returns the video source object that is
currently selected at the time the function is called. If you change the value
of the
SelectedSourceName property, you must call the getselect edsource
function again to retrieve the new selected video source object.
Getting Information About a Video Input Object
After creating a video input object, you can get information about the device
it represents using the
imaqhwinfo function. When call ed w i th a video
inputobjectasanargument,
imaqhwinfo returns a structure containing
information about the object such as the name of the adaptor, name of the
device, video resolution, and details of the v endor’s device driver and version.
out = imaqhwinfo(vid)
out =
AdaptorName: 'winvi deo'
DeviceName: 'IBM PC Camera'
MaxHeight: 96
MaxWidth: 128
NativeDataType: 'u int8 '
TotalSources: 1
VendorDriverDescription: 'Windows WDM Compatible Driver'
VendorDriverVersion: 'DirectX 9.0'
4-16