
Machine Vision Camera SDK (C) Developer Guide
printf("Input error!Use default strategy:MV_GrabStrategy_OneByOne
\n");
break;
}
//Start grabbing image
nRet = MV_CC_StartGrabbing(handle);
if (MV_OK != nRet)
{
printf("Start Grabbing fail! nRet [0x%x]\n", nRet);
break;
}
//Send trigger software command
for (unsigned int i = 0;i < nImageNodeNum;i++)
{
nRet = MV_CC_SetCommandValue(handle, "TriggerSoftware");
if (MV_OK != nRet)
{
printf("Send Trigger Software command fail! nRet [0x%x]\n",
nRet);
break;
}
Sleep(500);//Make sure that the trigger software command takes
effect and the last frame data has been stored in buffer list
}
MV_FRAME_OUT stOutFrame = {0};
if (nGrabStrategy != MV_GrabStrategy_UpcomingImage)
{
while(true)
{
nRet = MV_CC_GetImageBuffer(handle, &stOutFrame, 0);
if (nRet == MV_OK)
{
printf("Get One Frame: Width[%d], Height[%d], FrameNum[%d]
\n",
stOutFrame.stFrameInfo.nWidth,
stOutFrame.stFrameInfo.nHeight, stOutFrame.stFrameInfo.nFrameNum);
}
else
{
break;
}
nRet = MV_CC_FreeImageBuffer(handle, &stOutFrame);
if(nRet != MV_OK)
{
printf("Free Image Buffer fail! nRet [0x%x]\n", nRet);
}
}
}
54



































































































































































































































































































































































































