跳转到内容

Sequencer(ace 2 和 boost R)#

相机功能 Sequencer 允许您定义参数设置集,并将其应用于图像序列。

您可以定义多达 32 组参数设置(称为定序器集)。当相机接收到触发信号时,会逐个应用定序器集。

例如,您可以使用 Sequencer 功能,在预配置的图像 ROI曝光时间之间快速切换。

该功能的使用#

定序器模式#

  • 定序器配置模式下,您可以配置定序器,但不能操作。
  • 定序器模式下,您可以操作定序器,但无法配置。

Sequencer 配置模式#

要启用定序器配置模式:

  1. 设置 SequencerMode parameter to 熄灭.
  2. 设置 SequencerConfigurationMode parameter to .

您现在可以配置定序器。

信息

  • 在配置模式下,某些相机参数可能不可用,即已设为只读。请检查 pylon Viewer 中的特征 - 全部窗格,以了解哪些参数可用。

Sequencer 模式#

To enable the sequencer mode, set the SequencerMode parameter to . This automatically disables the sequencer configuration mode.

定序器现在已准备好接收触发信号并按配置推进

信息

  • By default, when enabling the sequencer mode, the camera immediately loads sequencer set 0. To change this behavior, set the SequencerSetStart parameter to the desired start set.
  • 在定序器模式下,某些相机参数可能不可用,即已设为只读。请检查 pylon Viewer 中的特征 - 全部窗格,以了解哪些参数可用。
  • 在定序器模式下,根据所配置的定序器集计算某些相机参数值:
    • 即: PayloadSize parameter value reflects the size of the largest sequencer set configured.
    • The maximum possible number of images in a burst of images, i.e., the maximum value of the AcquisitionBurstFrameCount parameter, is calculated using the largest sequencer set configured.
  • You can use the SequencerSetActive parameter to find out which sequencer set is currently active.
  • 如果可用,您可以使用 Sequencer 集激活块来跟踪所使用的定序器集。启用后,每个图像都包含块数据,该数据包括用于图像采集的定序器集的索引号。

定序器集中包含什么?#

定序器集包含以下参数(如果可用):

  • AutoFunctionROIWidtha
  • AutoFunctionROIHeighta
  • AutoFunctionROIOffsetXa
  • AutoFunctionROIOffsetYa
  • BinningHorizontalab
  • BinningVerticalab
  • BinningHorizontalModeab
  • BinningVerticalModeab
  • ExposureTimec
  • Gain
  • Heightad
  • OffsetXad
  • OffsetYad
  • PixelFormata
  • SequencerSetNext
  • SequencerTriggerActivation
  • SequencerTriggerSource
  • Widthad

  1. Not available on Basler ace 2 V and boost cameras.

  2. 仅存储 FPGA Binning 的设置。

  3. 操作或配置定序器时,Exposure Time 模式预设为 Standard 且无法更改。

  4. 在操作或配置定序器时,Multiple ROI 功能会被禁用。

其他所有相机参数均无法使用 Sequencer 功能控制。

信息

加载或保存定序器集将始终加载或保存以上所有参数,包括您未更改的参数在内。例如,如果仅更改 Exposure Time 并保留所有其他参数的默认值,则所有其他参数的值也将被存储,并在加载时被覆盖

配置 Sequencer#

Basler 建议分两步配置定序器:

  1. 使用所需的相机设置(例如,Exposure Time 或 Image ROI)填充定序器集
  2. 配置定序器集推进,即,定义定序器应如何以及何时从一个定序器集推进到下一个定序器集。

填充 Sequencer 集#

每个定序器集都有一个唯一的索引号,范围从 0 到 31。您可以使用所需的相机设置(例如,Exposure Time 或 Image ROI)填充这些定序器集。

若要填充定序器集:

  1. 确保定序器处于配置模式
  2. 配置要存储在定序器集中的相机参数
  3. 设置 SequencerSetSelector parameter to the index number of the desired set.
  4. Execute the SequencerSetSave command.
  5. 对要使用的所有定序器集重复步骤 2 至 4。

示例:假设您想要使用不同的 Image ROI 设置来填充定序器集 0 和 1。为此:

  1. Create the first image ROI by adjusting the Width, Height, OffsetX, and OffsetY parameter values.
  2. 保存定序器集 0。
  3. Create the second image ROI by choosing different values for the Width, Height, OffsetX, and OffsetY parameters.
  4. 保存定序器集 1。

您随后可以配置定序器集推进,以便相机在两个 Image ROI 之间快速切换。

配置 Sequencer 集推进#

要控制定序器,您必须定义定序器应如何以及何时从一个定序器集推进到下一个定序器集。

对于每个定序器集,您必须定义以下内容:

标准 参数
下一个定序器集应该是什么? SequencerSetNext
定序器应根据哪个触发信号推进到下一个定序器集? SequencerTriggerSource
触发信号何时应被视为有效,例如,在信号的上升沿还是下降沿? SequencerTriggerActivation

如果需要,您可以通过配置所谓的路径,为每个定序器集定义上述内容两次。例如,您可以定义当接收到第 3 行上的触发信号时(= 路径 0),相机应推进到定序器集 1,而当接收到第 4 行上的触发器信号时(= 路径 1),相机推进到定序器集 3。

当所有这些都设置好后,相机就知道何时以及如何在定序器集之间转换,本质上就像一个状态机

Sequencer 集推进独立于帧触发

定序器可以独立于图像采集推进。始终使用在相机接收到帧触发信号时处于活动状态的定序器集来获取图像。

例如,您可以使用输入线路 3 触发定序器集推进,但使用线路 4 触发图像。

If you want to synchronize sequencer advance with image acquisition, Basler recommends setting the sequencer trigger source to ExposureStart.

不要将定序器和帧开始 Trigger Source 设置为同一信号源。否则,相机可能会显示不可预测的行为。

若要配置定序器集推进:

  1. 确保定序器处于配置模式
  2. 设置 SequencerSetSelector parameter to the 第一个 sequencer set to be configured.
  3. Execute the SequencerSetLoad command.
  4. 为路径 0 配置定序器集推进:
    1. 设置 SequencerPathSelector parameter to 0.
    2. 设置 SequencerSetNext parameter to the next set to be configured.
    3. 设置 SequencerTriggerSource parameter to the source signal that should be used to advance to the next set.
      You can select any of the available trigger source signals, e.g., Line1ExposureStart.
    4. 如果您选择的 Trigger Source 可能是高电平 (1) 或低电平 (0),即 I/O 信号,请设置 SequencerTriggerActivation 参数设置为以下值:
      • RisingEdge (default): The sequencer advances when the source signal rises, i.e., when the signal status changes from low to high.
      • FallingEdge: The sequencer advances when the source signal falls, i.e., when the signal status changes from high to low.
      • AnyEdge: The sequencer advances when the source signal falls or rises.
      • LevelHigh: The sequencer advances when the source signal is high. If the signal is already high when the sequencer set is loaded, the sequencer immediately advances to the next set. This happens independently of image acquisition.
      • LevelLow: The sequencer advances when the source signal is low. If the signal is already low when the sequencer set is loaded, the sequencer immediately advances to the next set. This happens independently of image acquisition.
  5. If you want to define a second condition on which you want the camera to advance to a different set, repeat step 4 with the SequencerPathSelector parameter set to 1.
  6. Execute the SequencerSetSave command.
  7. 设置 SequencerSetSelector parameter to the next sequencer set to be configured.
  8. 对所有需要的定序器集重复步骤 3 至 7。

示例#

示例 1:循环遍历定序器集#

假设您想要在图像采集期间循环遍历定序器集 0、1 和 2。每当相机获取图像时,定序器应推进到下一个定序器集。

示例 1 状态图

为此,按如下方式设置定序器:

Sequencer 集选择器 Sequencer 路径选择器 Sequencer Trigger Source Sequencer Trigger Activation 下一个 Sequencer 集
0 0 ExposureStart - 1
1 0 ExposureStart - 2
2 0 ExposureStart - 0

下面概述了如上所示设置定序器会发生什么情况:

  • 启用后,定序器从序列器集 0(默认)开始并等待第一张图像的曝光。
  • 当发生这种情况时,相机会将当前序列器集 0 应用于图像,然后推进到序列器集 1。
  • 当下一次曝光开始时,相机会应用定序器集 1 并推进到定序器集 2。
  • 当下一次曝光开始时,相机会应用定序器集 2 并推进到定序器集 0。
  • 现在,定序器已返回定序器集 0,并重复上述过程。

示例 2:使用一个 Counter 和多条路径#

您可以将定序器设置为每采集第 n 张图像时推进到特定的定序器集。

这涉及使用 Counter 功能和配置多条路径。

假设您想要在图像采集期间在定序器集 0 和 1 之间交替,但在采集第一张图像及每采集第 10 张图像时,应该使用定序器集 2。

示例 2 状态图

为此:

  1. 设置 SequencerStartSet parameter to 2.
  2. Configure counter 1 as follows:

    • CounterDuration = 10
    • CounterEventSource = ExposureStart
    • CounterResetSource = Counter1End
  3. 如下表所示设置定序器。

Sequencer 集选择器 Sequencer 路径选择器 Sequencer Trigger Source Sequencer Trigger Activation 下一个 Sequencer 集
0 0 ExposureActive FallingEdge 1
0 1 Counter1End - 2
1 0 ExposureActive FallingEdge 0
1 1 Counter1End - 2
2 0 ExposureActive FallingEdge 0

信息

  • 在开始图像采集之前,确保计数器已复位。否则就不算数。
  • 在上面的配置中,请注意计数器是使用曝光开始信号进行触发,而定序器集推进是使用具有下降沿激活的曝光激活信号进行触发。这有助于避免路径 0 和路径 1 之间的时序冲突。

下面概述了如上所示设置定序器会发生什么情况:

  • 启用后,定序器从序列器集 2 开始并等待第一张图像的曝光。
  • 当第一次曝光开始时,Counter 1 从 0 增加到 1,因为它被配置为进行曝光开始事件计数。
  • 当第一次曝光结束时,即,当曝光激活信号下降时,定序器会推进到定序器集 0。
  • 对于接下来的 8 次图像采集,定序器在定序器集 0 和定序器集 1 之间交替,计数器值继续增加。每当曝光结束时,即当曝光激活信号下降时,定序器就会推进。
  • When the exposure of the 10th image starts, the counter reaches its maximum value (CounterDuration = 10), resets itself, and the camera sends a Counter 1 End signal. This makes the sequencer advance to set 2 on path 1 before the path 0 trigger condition (ExposureActive, FallingEdge) becomes valid.
  • 现在,定序器已返回定序器集 2,并重复上述过程。

示例 3:运行时选择#

您可以设置定序器以根据需要在运行时选择定序器集。

This involves configuring multiple I/O lines as trigger sources and using the LevelLow and LevelHigh options of the SequencerTriggerActivation parameter.

假设您想要使用输入线路 2 和 3 的信号状态(0 = 低电平,1 = 高电平)来控制定序器集选择。根据线路的状态,您希望定序器按如下方式操作:

信号状态线路 2 信号状态线路 3 精选集
0 0 0
0 1 1
1 0 2
1 1 3

为此,按如下方式设置定序器:

Sequencer 集选择器 Sequencer 路径选择器 Sequencer Trigger Source Sequencer Trigger Activation 下一个 Sequencer 集
0 0 Line3 LineHigh 1
0 1 Line2 LineHigh 2
1 0 Line3 LineLow 0
1 1 Line2 LineHigh 3
2 0 Line3 LineHigh 3
2 1 Line2 LineLow 0
3 0 Line3 LineLow 2
3 1 Line2 LineLow 1

下面概述了如上所示设置定序器会发生什么情况:

  • As long as both signals are low, the triggers on Line 2 and Line 3 stay inactive, because their trigger activation is set to LineHigh. See table rows 1 and 2. Therefore, the sequencer remains at set 0.
  • When the signal on Line 3 rises, the LineHigh activation occurs, and the sequencer immediately advances from set 0 to set 1. See table row 1. Then, the sequencer remains at set 1, because Line 2 is still low.
  • 当线路 2 上的信号也上升时,定序器会从定序器集 1 推进到定序器集 3。请参阅表的第 4 行。
  • 当线路 2 上的信号下降时,定序器会推进回到定序器集 1。请参阅表的第 8 行。
  • 当线路 3 上的信号也下降时,定序器会推进回到定序器集 0。请参阅表的第 3 行。

信息

  • 如果您同时更改两条线路上的 I/O 信号,这也有效,比方说,将两条 I/O 线路的状态从高切换到低。
  • 图像采集必须单独触发。当 I/O Line Status 改变时,定序器可能在帧之间推进多次。

示例代码#

// ** Populating the Sequencer Sets **
// Enable sequencer configuration mode
camera.SequencerMode.SetValue(SequencerMode_Off);
camera.SequencerConfigurationMode.SetValue(SequencerConfigurationMode_On);
// Configure parameters to be stored in the first sequencer set
camera.Width.SetValue(600);
camera.Height.SetValue(300);
// Select sequencer set 0 and save the parameter values
camera.SequencerSetSelector.SetValue(0);
camera.SequencerSetSave.Execute();
// Configure parameters to be stored in the second sequencer set
camera.Width.SetValue(800);
camera.Height.SetValue(600);
// Select sequencer set 1 and save the parameter values
camera.SequencerSetSelector.SetValue(1);
camera.SequencerSetSave.Execute();
// Enable sequencer mode to operate the sequencer
camera.SequencerMode.SetValue(SequencerMode_On);
// ** Configuring sequencer set advance **
// Assume you want to alternate between sequencer sets 0 and 1 using input line 3
// Enable sequencer configuration mode
camera.SequencerMode.SetValue(SequencerMode_Off);
camera.SequencerConfigurationMode.SetValue(SequencerConfigurationMode_On);
// Set the start set to set 0
camera.SequencerSetStart.SetValue(0);
// Load and configure sequencer set 0
camera.SequencerSetSelector.SetValue(0);
camera.SequencerSetLoad.Execute();
camera.SequencerPathSelector.SetValue(0);
camera.SequencerSetNext.SetValue(1);
camera.SequencerTriggerSource.SetValue(SequencerTriggerSource_Line3);
camera.SequencerTriggerActivation.SetValue(SequencerTriggerActivation_RisingEdge);
// Save the changes
camera.SequencerSetSave.Execute();
// Load and configure sequencer set 1
camera.SequencerSetSelector.SetValue(1);
camera.SequencerSetLoad.Execute();
camera.SequencerPathSelector.SetValue(0);
camera.SequencerSetNext.SetValue(2);
camera.SequencerTriggerSource.SetValue(SequencerTriggerSource_Line3);
camera.SequencerTriggerActivation.SetValue(SequencerTriggerActivation_RisingEdge);
// Save the changes
camera.SequencerSetSave.Execute();
// Enable sequencer mode to operate the sequencer
camera.SequencerMode.SetValue(SequencerMode_On);
INodeMap& nodemap = camera.GetNodeMap();
// ** Populating the Sequencer Sets **
// Enable sequencer configuration mode
CEnumParameter(nodemap, "SequencerMode").SetValue("Off");
CEnumParameter(nodemap, "SequencerConfigurationMode").SetValue("On");
// Configure parameters to be stored in the first sequencer set
CIntegerParameter(nodemap, "Width").SetValue(600);
CIntegerParameter(nodemap, "Height").SetValue(300);
// Select sequencer set 0 and save the parameter values
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(0);
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Configure parameters to be stored in the second sequencer set
CIntegerParameter(nodemap, "Width").SetValue(800);
CIntegerParameter(nodemap, "Height").SetValue(600);
// Select sequencer set 1 and save the parameter values
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(1);
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Enable sequencer mode to operate the sequencer
CEnumParameter(nodemap, "SequencerMode").SetValue("On");
// ** Configuring sequencer set advance **
// Assume you want to alternate between sequencer sets 0 and 1 using input line 3
// Enable sequencer configuration mode
CEnumParameter(nodemap, "SequencerMode").SetValue("Off");
CEnumParameter(nodemap, "SequencerConfigurationMode").SetValue("On");
// Set the start set to set 0
CIntegerParameter(nodemap, "SequencerSetStart").SetValue(0);
// Load and configure sequencer set 0
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(0);
CCommandParameter(nodemap, "SequencerSetLoad").Execute();
CIntegerParameter(nodemap, "SequencerPathSelector").SetValue(0);
CIntegerParameter(nodemap, "SequencerSetNext").SetValue(1);
CEnumParameter(nodemap, "SequencerTriggerSource").SetValue("Line3");
CEnumParameter(nodemap, "SequencerTriggerActivation").SetValue("RisingEdge");
// Save the changes
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Load and configure sequencer set 1
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(1);
CCommandParameter(nodemap, "SequencerSetLoad").Execute();
CIntegerParameter(nodemap, "SequencerPathSelector").SetValue(0);
CIntegerParameter(nodemap, "SequencerSetNext").SetValue(2);
CEnumParameter(nodemap, "SequencerTriggerSource").SetValue("Line3");
CEnumParameter(nodemap, "SequencerTriggerActivation").SetValue("RisingEdge");
// Save the changes
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Enable sequencer mode to operate the sequencer
CEnumParameter(nodemap, "SequencerMode").SetValue("On");
// ** Populating the Sequencer Sets **
// Enable sequencer configuration mode
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.Off);
camera.Parameters[PLCamera.SequencerConfigurationMode].SetValue(PLCamera.SequencerConfigurationMode.On);
// Configure parameters to be stored in the first sequencer set
camera.Parameters[PLCamera.Width].SetValue(600);
camera.Parameters[PLCamera.Height].SetValue(300);
// Select sequencer set 0 and save the parameter values
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(0);
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Configure parameters to be stored in the second sequencer set
camera.Parameters[PLCamera.Width].SetValue(800);
camera.Parameters[PLCamera.Height].SetValue(600);
// Select sequencer set 1 and save the parameter values
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(1);
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Enable sequencer mode to operate the sequencer
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.On);
// ** Configuring sequencer set advance **
// Assume you want to alternate between sequencer sets 0 and 1 using input line 3
// Enable sequencer configuration mode
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.Off);
camera.Parameters[PLCamera.SequencerConfigurationMode].SetValue(PLCamera.SequencerConfigurationMode.On);
// Set the start set to set 0
camera.Parameters[PLCamera.SequencerSetStart].SetValue(0);
// Load and configure sequencer set 0
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(0);
camera.Parameters[PLCamera.SequencerSetLoad].Execute();
camera.Parameters[PLCamera.SequencerPathSelector].SetValue(0);
camera.Parameters[PLCamera.SequencerSetNext].SetValue(1);
camera.Parameters[PLCamera.SequencerTriggerSource].SetValue(PLCamera.SequencerTriggerSource.Line3);
camera.Parameters[PLCamera.SequencerTriggerActivation].SetValue(PLCamera.SequencerTriggerActivation.RisingEdge);
// Save the changes
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Load and configure sequencer set 1
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(1);
camera.Parameters[PLCamera.SequencerSetLoad].Execute();
camera.Parameters[PLCamera.SequencerPathSelector].SetValue(0);
camera.Parameters[PLCamera.SequencerSetNext].SetValue(2);
camera.Parameters[PLCamera.SequencerTriggerSource].SetValue(PLCamera.SequencerTriggerSource.Line3);
camera.Parameters[PLCamera.SequencerTriggerActivation].SetValue(PLCamera.SequencerTriggerActivation.RisingEdge);
// Save the changes
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Enable sequencer mode to operate the sequencer
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.On);
/* 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 */
/* ** Populating the Sequencer Sets ** */
/* Enable sequencer configuration mode */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerMode", "Off");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequencerConfigurationMode", "On");
CHECK(errRes);
/* Configure parameters to be stored in the first sequencer set */
errRes = PylonDeviceSetIntegerFeature(hdev, "Width", 600);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "Height", 300);
CHECK(errRes);
/* Select sequencer set 0 and save the parameter values */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 0);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetSave");
CHECK(errRes);
/* Configure parameters to be stored in the second sequencer set */
errRes = PylonDeviceSetIntegerFeature(hdev, "Width", 800);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "Height", 600);
CHECK(errRes);
/* Select sequencer set 1 and save the parameter values */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 1);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetSave");
CHECK(errRes);
/* Enable sequencer mode to operate the sequencer */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerMode", "On");
CHECK(errRes);
/* ** Configuring sequencer set advance ** */
/* Assume you want to alternate between sequencer sets 0 and 1 using input line 3 */
/* Enable sequencer configuration mode */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerMode", "Off");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequencerConfigurationMode", "On");
CHECK(errRes);
/* Set the start set to set 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetStart", 0);
CHECK(errRes);
/* Load and configure sequencer set 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 0);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetLoad");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerPathSelector", 0);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetNext", 1);
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequencerTriggerSource", "Line3");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequencerTriggerActivation", "RisingEdge");
CHECK(errRes);
/* Save the changes */
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetSave");
CHECK(errRes);
/* Load and configure sequencer set 1 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 1);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetLoad");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerPathSelector", 0);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetNext", 2);
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequencerTriggerSource", "Line3");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequencerTriggerActivation", "RisingEdge");
CHECK(errRes);
/* Save the changes */
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetSave");
CHECK(errRes);
/* Enable sequencer mode to operate the sequencer */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerMode", "On");
CHECK(errRes);
# ** Populating the Sequencer Sets **
# Enable sequencer configuration mode
camera.SequencerMode.Value = "Off"
camera.SequencerConfigurationMode.Value = "On"
# Configure parameters to be stored in the first sequencer set
camera.Width.Value = 600
camera.Height.Value = 300
# Select sequencer set 0 and save the parameter values
camera.SequencerSetSelector.Value = 0
camera.SequencerSetSave.Execute()
# Configure parameters to be stored in the second sequencer set
camera.Width.Value = 800
camera.Height.Value = 600
# Select sequencer set 1 and save the parameter values
camera.SequencerSetSelector.Value = 1
camera.SequencerSetSave.Execute()
# Enable sequencer mode to operate the sequencer
camera.SequencerMode.Value = "On"
# ** Configuring sequencer set advance **
# Assume you want to alternate between sequencer sets 0 and 1 using input line 3
# Enable sequencer configuration mode
camera.SequencerMode.Value = "Off"
camera.SequencerConfigurationMode.Value = "On"
# Set the start set to set 0
camera.SequencerSetStart.Value = 0
# Load and configure sequencer set 0
camera.SequencerSetSelector.Value = 0
camera.SequencerSetLoad.Execute()
camera.SequencerPathSelector.Value = 0
camera.SequencerSetNext.Value = 1
camera.SequencerTriggerSource.Value = "Line3"
camera.SequencerTriggerActivation.Value = "RisingEdge"
# Save the changes
camera.SequencerSetSave.Execute()
# Load and configure sequencer set 1
camera.SequencerSetSelector.Value = 1
camera.SequencerSetLoad.Execute()
camera.SequencerPathSelector.Value = 0
camera.SequencerSetNext.Value = 2
camera.SequencerTriggerSource.Value = "Line3"
camera.SequencerTriggerActivation.Value = "RisingEdge"
# Save the changes
camera.SequencerSetSave.Execute()
# Enable sequencer mode to operate the sequencer
camera.SequencerMode.Value = "On"

您也可以使用 pylon Viewer 轻松设置参数。