Acquisition Mode#
信息
- 无法通过 pylon Viewer 功能树使用此功能。在使用 pylon Viewer 工具栏中的单拍和连拍按钮时,可以自动设定 acquisition mode。
- The pylon C++ API and the pylon .NET API provide configuration event handlers that set the
AcquisitionMode
parameter automatically. Basler recommends using these event handlers.
该功能的使用#
指定 Acquisition Mode#
To specify the acquisition mode, set the AcquisitionMode
参数设置为以下值:
SingleFrame
: Enables the Single Frame acquisition mode.Continuous
: Enables the Continuous acquisition mode.
可用 Acquisition Mode#
单帧 Acquisition Mode#
在单帧采集模式下,相机将仅采集一张图像。
执行采集开始命令后,相机会等待触发信号。触发信号既可以在相机内部生成(自由运行),也可以通过外部施加(触发图像采集)。
信息
To check whether the camera is waiting for trigger signals, monitor the camera's Trigger Wait signals or use the Acquisition Status feature, if available.
When a Frame Start trigger signal or a Line Start trigger signal have been received and an image has been acquired, the camera switches off image acquisition. To acquire another image, you must execute the Acquisition Start command again.
连续 Acquisition Mode#
在连续采集模式下,相机将连续采集并传输图像,直到关闭采集功能为止。
执行采集开始命令后,相机会等待触发信号。触发信号既可以在相机内部生成(自由运行图像采集),也可以通过外部应用(触发图像采集)。相机将持续采集图像,直至执行了采集停止命令。
示例代码#
// Configure single frame acquisition on the camera
camera.AcquisitionMode.SetValue(AcquisitionMode_SingleFrame);
// Switch on image acquisition
camera.AcquisitionStart.Execute();
// The camera waits for a trigger signal.
// When a Frame Start trigger signal has been received,
// the camera executes an Acquisition Stop command internally.
// Configure continuous image acquisition on the camera
camera.AcquisitionMode.SetValue(AcquisitionMode_Continuous);
// Switch on image acquisition
camera.AcquisitionStart.Execute();
// The camera waits for trigger signals.
// (...)
// Switch off image acquisition
camera.AcquisitionStop.Execute();
INodeMap& nodemap = camera.GetNodeMap();
// Configure single frame acquisition on the camera
CEnumParameter(nodemap, "AcquisitionMode").SetValue("SingleFrame");
// Switch on image acquisition
CCommandParameter(nodemap, "AcquisitionStart").Execute();
// The camera waits for a trigger signal.
// When a Frame Start trigger signal has been received,
// the camera executes an Acquisition Stop command internally.
// Configure continuous image acquisition on the camera
CEnumParameter(nodemap, "AcquisitionMode").SetValue("Continuous");
// Switch on image acquisition
CCommandParameter(nodemap, "AcquisitionStart").Execute();
// The camera waits for trigger signals.
// (...)
// Switch off image acquisition
CCommandParameter(nodemap, "AcquisitionStop").Execute();
// Configure single frame acquisition on the camera
camera.Parameters[PLCamera.AcquisitionMode].SetValue(PLCamera.AcquisitionMode.SingleFrame);
// Switch on image acquisition
camera.Parameters[PLCamera.AcquisitionStart].Execute();
// The camera waits for a trigger signal.
// When a Frame Start trigger signal has been received,
// the camera executes an Acquisition Stop command internally.
// Configure continuous image acquisition on the camera
camera.Parameters[PLCamera.AcquisitionMode].SetValue(PLCamera.AcquisitionMode.Continuous);
// Switch on image acquisition
camera.Parameters[PLCamera.AcquisitionStart].Execute();
// The camera waits for trigger signals.
// (...)
// Switch off image acquisition
camera.Parameters[PLCamera.AcquisitionStop].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 single frame acquisition on the camera */
errRes = PylonDeviceFeatureFromString(hdev, "AcquisitionMode", "SingleFrame");
CHECK(errRes);
/* Switch on image acquisition */
errRes = PylonDeviceExecuteCommandFeature(hdev, "AcquisitionStart");
CHECK(errRes);
/* The camera waits for a trigger signal. */
/* When a Frame Start trigger signal has been received, */
/* the camera executes an Acquisition Stop command internally. */
/* Configure continuous image acquisition on the camera */
errRes = PylonDeviceFeatureFromString(hdev, "AcquisitionMode", "Continuous");
CHECK(errRes);
/* Switch on image acquisition */
errRes = PylonDeviceExecuteCommandFeature(hdev, "AcquisitionStart");
CHECK(errRes);
/* The camera waits for trigger signals. */
/* (...) */
/* Switch off image acquisition */
errRes = PylonDeviceExecuteCommandFeature(hdev, "AcquisitionStop");
CHECK(errRes);
# Configure single frame acquisition on the camera
camera.AcquisitionMode.Value = "SingleFrame"
# Switch on image acquisition
camera.AcquisitionStart.Execute()
# The camera waits for a trigger signal.
# When a Frame Start trigger signal has been received,
# the camera executes an Acquisition Stop command internally.
# Configure continuous image acquisition on the camera
camera.AcquisitionMode.Value = "Continuous"
# Switch on image acquisition
camera.AcquisitionStart.Execute()
# The camera waits for trigger signals.
# (...)
# Switch off image acquisition
camera.AcquisitionStop.Execute()
您也可以使用 pylon Viewer 轻松设置参数。