These commands aren't available via the pylon Viewer feature tree. Instead, AcquisitionStart and AcquisitionStop commands are generated automatically when you use the acquisition buttons on the toolbar of the pylon Viewer.
The pylon C++ API provides camera classes that handle these commands automatically. Basler recommends using these classes. For more information, see the "Grab" code samples in the C++ Programmer's Guide and Reference Documentation delivered with the Basler pylon Software Suite.
// Configure continuous image acquisition on the camerascamera.AcquisitionMode.SetValue(AcquisitionMode_Continuous);// Switch on image acquisitioncamera.AcquisitionStart.Execute();// (...)// Switch off image acquisitioncamera.AcquisitionStop.Execute();// Switch image acquisition back oncamera.AcquisitionStart.Execute();
INodeMap&nodemap=camera.GetNodeMap();// Configure continuous image acquisition on the camerasCEnumParameter(nodemap,"AcquisitionMode").SetValue("Continuous");// Switch on image acquisitionCCommandParameter(nodemap,"AcquisitionStart").Execute();// (...)// Switch off image acquisitionCCommandParameter(nodemap,"AcquisitionStop").Execute();// Switch image acquisition back onCCommandParameter(nodemap,"AcquisitionStart").Execute();
// Configure continuous image acquisition on the camerascamera.Parameters[PLCamera.AcquisitionMode].SetValue(PLCamera.AcquisitionMode.Continuous);// Switch on image acquisitioncamera.Parameters[PLCamera.AcquisitionStart].Execute();// (...)// Switch off image acquisitioncamera.Parameters[PLCamera.AcquisitionStop].Execute();// Switch image acquisition back oncamera.Parameters[PLCamera.AcquisitionStart].Execute();
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods *//* Configure continuous image acquisition on the cameras */errRes=PylonDeviceFeatureFromString(hdev,"AcquisitionMode","Continuous");CHECK(errRes);/* Switch on image acquisition */errRes=PylonDeviceExecuteCommandFeature(hdev,"AcquisitionStart");CHECK(errRes);/* (...) *//* Switch off image acquisition */errRes=PylonDeviceExecuteCommandFeature(hdev,"AcquisitionStop");CHECK(errRes);/* Switch image acquisition back on */errRes=PylonDeviceExecuteCommandFeature(hdev,"AcquisitionStart");CHECK(errRes);
# Configure continuous image acquisition on the camerascamera.AcquisitionMode.Value="Continuous"# Switch on image acquisitioncamera.AcquisitionStart.Execute()# (...)# Switch off image acquisitioncamera.AcquisitionStop.Execute()# Switch image acquisition back oncamera.AcquisitionStart.Execute()
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods *//* Configure continuous image acquisition on the cameras */errRes=PylonDeviceFeatureFromString(hdev,"AcquisitionMode","Continuous");CHECK(errRes);/* Switch on image acquisition */errRes=PylonDeviceExecuteCommandFeature(hdev,"AcquisitionStart");CHECK(errRes);/* (...) *//* Switch off image acquisition */errRes=PylonDeviceExecuteCommandFeature(hdev,"AcquisitionStop");CHECK(errRes);/* Switch image acquisition back on */errRes=PylonDeviceExecuteCommandFeature(hdev,"AcquisitionStart");CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.