Acquisition Start and Stop (dart E)#
情報
- These commands aren't available via the pylon Viewer feature tree. Instead,
AcquisitionStart
andAcquisitionStop
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.
機能を使用する#
To switch on image acquisition, execute the AcquisitionStart
command.
To switch off image acquisition, execute the AcquisitionStop
command.
After the AcquisitionStop
command has been executed, the following occurs:
- カメラが現在フレームを取得していない場合、画像取得は直ちにオフになります。
- カメラが現在画像データを読み取っている場合、読み取りプロセスは終了できます。その後、画像取得がオフになります。
- カメラが現在フレームを露光している場合、露光は中断されます。カメラはすぐに露光を停止し、画像データの読み出しを開始します。読み出しプロセスは終了できます。その後、画像取得はオフになります。
サンプルコード#
// Configure continuous image acquisition on the cameras
camera.AcquisitionMode.SetValue(AcquisitionMode_Continuous);
// Switch on image acquisition
camera.AcquisitionStart.Execute();
// (...)
// Switch off image acquisition
camera.AcquisitionStop.Execute();
// Switch image acquisition back on
camera.AcquisitionStart.Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Configure continuous image acquisition on the cameras
CEnumParameter(nodemap, "AcquisitionMode").SetValue("Continuous");
// Switch on image acquisition
CCommandParameter(nodemap, "AcquisitionStart").Execute();
// (...)
// Switch off image acquisition
CCommandParameter(nodemap, "AcquisitionStop").Execute();
// Switch image acquisition back on
CCommandParameter(nodemap, "AcquisitionStart").Execute();
// Configure continuous image acquisition on the cameras
camera.Parameters[PLCamera.AcquisitionMode].SetValue(PLCamera.AcquisitionMode.Continuous);
// Switch on image acquisition
camera.Parameters[PLCamera.AcquisitionStart].Execute();
// (...)
// Switch off image acquisition
camera.Parameters[PLCamera.AcquisitionStop].Execute();
// Switch image acquisition back on
camera.Parameters[PLCamera.AcquisitionStart].Execute();
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = 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 cameras
camera.AcquisitionMode.Value = "Continuous"
# Switch on image acquisition
camera.AcquisitionStart.Execute()
# (...)
# Switch off image acquisition
camera.AcquisitionStop.Execute()
# Switch image acquisition back on
camera.AcquisitionStart.Execute()
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = 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);
pylonViewerアを使用して、パラメーターを簡単に設定することもできます。