At least four steps are necessary to capture a single image from a Balluff device. These steps are explained with the help of source examples from ImpactControlCenter.
\endif
A live acquisition (running inside a thread function) could be implemented as follows:
\code
HOBJ getProp( HDRV hDrv,
TDMR_ListType lt,
const char* pPropName,
const char* pListName )
{
HOBJ hProp;
HLIST hList;
{
{
printf( "OBJ_GetHandle failed: %d Handle: %d\n", objResult, hProp );
}
}
else
{
printf( "DMR_FindList failed: %d\n", dmrResult );
}
return hProp;
}
void threadFn( HDRV hDriverInterface )
{
HOBJ hReqCnt, hPropFPS;
hPropFPS = getProp( hDriverInterface,
dmltStatistics,
"FramesPerSecond", 0 );
{
printf(
"DMR_ImageRequestSingle: Unexpected error(code: %d(%s))\n", result,
DMR_ErrorCodeToString( result ) );
}
while( !s_boTerminated )
{
{
frameCount = frameCount + 1;
if( ( frameCount % 100 ) == 0 )
{
printf( "frames per second: %.5f\n", fps );
}
{
}
else
{
printf( "DMR_GetImageRequestBuffer: ERROR! Code %d\n", result );
}
}
else
{
printf( "DMR_ImageRequestWaitFor: ERROR! Code %d\n", result );
}
}
}
int iHeight
The height of the image in pixel or lines.
Definition mvImageBuffer.h:98
int iWidth
The width of the image in pixel.
Definition mvImageBuffer.h:100
int iLinePitch
The offset (in bytes) to the next line of this channel.
Definition mvImageBuffer.h:70
void * vpData
The starting address of the image.
Definition mvImageBuffer.h:157
ChannelData * pChannels
A pointer to an array of channel specific image data.
Definition mvImageBuffer.h:166
int iPixelPitch
The offset (in bytes) to the next pixel of this channel.
Definition mvImageBuffer.h:72
TDMR_ERROR
Errors reported by the device manager.
Definition mvDriverBaseEnums.h:2601
TDMR_ListType
Defines valid interface list types, which can be located using the function DMR_FindList().
Definition mvDeviceManager.h:585
@ DEV_NO_FREE_REQUEST_AVAILABLE
The user requested a new image, but no free Request object is available to process this request.
Definition mvDriverBaseEnums.h:2713
@ DMR_NO_ERROR
The function call was executed successfully.
Definition mvDriverBaseEnums.h:2603
@ dmltStatistics
Specifies the driver interface list containing statistical information.
Definition mvDeviceManager.h:611
@ dmltSystemSettings
Specifies the driver interface list containing properties, which influence the overall operation of t...
Definition mvDeviceManager.h:617
Fully describes a captured image.
Definition mvImageBuffer.h:94
MVDMR_API TDMR_ERROR DMR_CALL DMR_ImageRequestSingle(HDRV hDrv, int requestCtrl, int *pRequestUsed)
Sends an image request to the device driver.
Definition mvDeviceManager.cpp:2663
MVDMR_API TDMR_ERROR DMR_CALL DMR_ImageRequestReset(HDRV hDrv, int requestCtrl, int mode)
Deletes all requests currently queued for the specified request control.
Definition mvDeviceManager.cpp:2618
MVDMR_API TDMR_ERROR DMR_CALL DMR_ImageRequestUnlock(HDRV hDrv, int requestNr)
Unlocks the request for the driver again.
Definition mvDeviceManager.cpp:2727
MVDMR_API TDMR_ERROR DMR_CALL DMR_ReleaseImageRequestBufferDesc(ImageBuffer **ppBuffer)
frees the memory previously allocated for the specified ImageBuffer structure again.
Definition mvDeviceManager.cpp:4324
MVDMR_API TDMR_ERROR DMR_CALL DMR_FindList(HDRV hDrv, const char *pName, TDMR_ListType type, unsigned int flags, HLIST *phDevList)
Locates a specified list within the device drivers interface.
Definition mvDeviceManager.cpp:2295
MVDMR_API const char *DMR_CALL DMR_ErrorCodeToString(int errorCode)
Returns a string representation of a given error code.
Definition mvDeviceManager.cpp:5383
MVDMR_API TDMR_ERROR DMR_CALL DMR_GetImageRequestBuffer(HDRV hDrv, int requestNr, ImageBuffer **ppBuffer)
Returns the ImageBuffer of the desired request.
Definition mvDeviceManager.cpp:3732
MVDMR_API TDMR_ERROR DMR_CALL DMR_ImageRequestWaitFor(HDRV hDrv, int timeout_ms, int queueNr, int *pRequestNr)
Waits for a request object to become ready.
Definition mvDeviceManager.cpp:2767
void MV_DISPLAY_API_CALL mvDispSetImage(TDisp *pDisp, const void *pData, int width, int height, int bitsPerPixel, int pitch)
Sets the next image to display.
Definition mvDisplay.cpp:750
void MV_DISPLAY_API_CALL mvDispUpdate(TDisp *pDisp)
Immediately redraws the current image.
Definition mvDisplay.cpp:809
TPROPHANDLING_ERROR DMR_CALL OBJ_GetHandle(HLIST hList, const char *pPathAndPropName, HOBJ *phObj)
Retrieves an objects handle(deprecated).
Definition ObjectHandling.cpp:289
TPROPHANDLING_ERROR
Error codes of the module handling everything related to properties.
Definition mvPropHandlingDatatypes.h:382
MVDMR_API TPROPHANDLING_ERROR DMR_CALL OBJ_GetF(HOBJ hProp, double *pVal, int index)
Receives a property's value as a float value.
Definition ObjectHandling.cpp:2956
@ PROPHANDLING_NO_ERROR
The operation has been executed successfully.
Definition mvPropHandlingDatatypes.h:384