
Frame Grabber SDK (Windows-C) Developer Guide
for (unsigned int i = 0; i < nDeviceNumber; i++)
{
MV_FG_DEVICE_INFO stDeviceInfo = {0};
nRet = MV_FG_GetDeviceInfo(hInterface, i, &stDeviceInfo);
if (MV_FG_SUCCESS != nRet)
{
printf("Get Info of No.%u Device error, %#x\n", i, nRet);
break;
}
if (stDeviceInfo.nDevType == MV_FG_CXP_DEVICE)
{
printf("[CXP]No.%d Device:
\n\tUserDefinedName: %s\n\tModelName: %s\n\tSerialNumber: %s\n", i,
stDeviceInfo.DevInfo.stCXPDevInfo.chUserDefinedName,
stDeviceInfo.DevInfo.stCXPDevInfo.chModelName,
stDeviceInfo.DevInfo.stCXPDevInfo.chSerialNumber);
}
else if (stDeviceInfo.nDevType == MV_FG_GEV_DEVICE)
{
printf("[GEV]No.%d Device:
\n\tUserDefinedName: %s\n\tModelName: %s\n\tSerialNumber: %s\n", i,
stDeviceInfo.DevInfo.stGEVDevInfo.chUserDefinedName,
stDeviceInfo.DevInfo.stGEVDevInfo.chModelName,
stDeviceInfo.DevInfo.stGEVDevInfo.chSerialNumber);
}
else if (stDeviceInfo.nDevType == MV_FG_CAMERALINK_DEVICE)
{
printf("[CML]No.%d Device:
\n\tUserDefinedName: %s\n\tModelName: %s\n\tSerialNumber: %s\n", i,
stDeviceInfo.DevInfo.stCMLDevInfo.chUserDefinedName,
stDeviceInfo.DevInfo.stCMLDevInfo.chModelName,
stDeviceInfo.DevInfo.stCMLDevInfo.chSerialNumber);
}
}
if (MV_FG_SUCCESS != nRet)
{
break;
}
// Select the device.
int nSelectedDeviceIndex = -1;
printf("Select a device: ");
scanf_s("%d", &nSelectedDeviceIndex);
ClearStdin();
if ((nSelectedDeviceIndex < 0) || (nSelectedDeviceIndex >= (int)nDeviceNumber))
{
printf("invalid device index, Quit\n");
break;
135





















































































































































