IMAQdxEnumerateCameras

NI-IMAQdx Function Reference

IMAQdxEnumerateCameras

Format

rval = IMAQdxEnumerateCameras (IMAQdxCameraInformation cameraInformationArray[], unsigned int *count, unsigned int connectedOnly);

Purpose

Returns a list of all cameras on the host computer. If you do not know in advance the number of cameras, complete the following steps:

  1. Call this function with the cameraInformationArray parameter set to NULL. The necessary size is then stored in count.
  2. Allocate cameraInformationArray with the given size.
  3. Call this function again using the previously allocated array.

Parameters

Parameter Type Description
cameraInformationArray IMAQdxCameraInformation [] An array of IMAQdxCameraInformation structure elements in which the interfaces supported by the system are stored. Set this parameter to NULL to get the size needed by the array in the count parameter.
count unsigned int (passed by reference) The size of the array used to store the camera information. If the user passes NULL as the cameraInformationArray parameter, this parameter contains the needed size.
connectedOnly unsigned int If the connectedOnly value is true, then the cameraInformationArray only contains cameras that are currently connected to the host computer. If the connectedOnly value is false, then the cameraInformationArray contains cameras that are currently connected, and were previously connected, to the host computer.

Parameter Discussion

The IMAQdxCameraInformation structure contains information about currently and previously connected interfaces. Once enumerated, check the Flags member of the IMAQdxCameraInformation structure. If the value of Flags is 0, the camera is not currently connected. If the value of Flags is 1, the camera is currently connected.

Return Value

On success, this function returns IMAQdxErrorSuccess. On failure, this function returns an error code. You can obtain a more detailed error message with IMAQdxGetErrorString.