Please enable JavaScript to view this site.

IDS peak 2.8.0 / uEye+ firmware 3.33

Navigation: C: Programming with IDS peak > How to program

Starting and stopping image acquisition

Scroll Previous Top Next More

comfortSDK

If you have not created any image buffers manually, the call of peak_Acquisition_Start creates internally managed image buffers. In this case, the call will need a little longer the first time.

With the 2nd parameter, you specify how many images are to be captured until the image acquisition is automatically stopped. In case of a continuous (never ending acquisition) the "PEAK_INFINITE" parameter is used.

genericSDK

After the buffer has been allocated (see Preparing image acquisition: create buffer), the system is ready and image acquisition can be started. To do this, start image acquisition in the DataStream. Also, you need to start image acquisition in the camera via the AcquisitionStart node in the RemoteDevice's NodeMap.

With the 2nd parameter, you specify how many images are to be captured until the image acquisition in the DataStream is stopped again. In case of continuous (never ending acquisition) the parameter "PEAK_INFINITE_NUMBER" is used.

Setting the "TLParamsLocked" parameter is necessary to lock all writable nodes in the XML tree that must not be modified during image acquisition.

Starting image acquisition

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
status = peak_Acquisition_Start(hCam, PEAK_INFINITE);
if (PEAK_ERROR(status)) { /* Error handling ... */ }

genericC++

dataStream->StartAcquisition(AcquisitionStartMode::Default, PEAK_INFINITE_NUMBER);
 
nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("TLParamsLocked")->SetValue(1);
nodemapRemoteDevice->FindNode<peak::core::nodes::CommandNode>("AcquisitionStart")->Execute();

Stopping image acquisition

comfortC

peak_status status = PEAK_STATUS_SUCCESS;
status = peak_Acquisition_Stop(hCam);
if (PEAK_ERROR(status)) { /* Error handling ... */ }

genericSDK: See also Preparing image acquisition: create buffer for the buffer handling in image acquisition.

genericC++

nodemapRemoteDevice->FindNode<peak::core::nodes::CommandNode>("AcquisitionStop")->Execute();
nodemapRemoteDevice->FindNode<peak::core::nodes::IntegerNode>("TLParamsLocked")->SetValue(0);
 
dataStream->StopAcquisition(AcquisitionStopMode::Default);

Complete example: Opening a camera, preparing image acquisition, setting a ROI, creating buffer and starting image acquisition

genericSDK:

1.Search and open the camera ("OpenCamera()").

2.Open the DataStream and get the NodeMap ("PrepareAcquisition()").

3.Set a ROI ("SetRoi()").

4.Create the buffer ("AllocAndAnounceBuffers()").

5.Start the image acquisition ("StartAcquisition()").

© 2024 IDS Imaging Development Systems GmbH