跳转到内容

Sequencer (ace Classic/U/L GigE)#

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

您可以定义多达 64 组参数设置(称为序列集)。相机采集图像时,会逐个应用序列集。这使您可以快速更改相机参数,而不会影响最大帧速率。

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

该功能的使用#

启用或禁用 Sequencer#

启用时,定序器将控制图像采集。无法在此状态下配置定序器。

禁用时,可以配置定序器,但定序器不控制图像采集。

要启用定序器:

  1. Set all auto functions (e.g., Gain Auto, Exposure Auto) to Off.
  2. Set the SequenceEnable parameter to true.

禁用定序器:

  1. Set the SequenceEnable parameter to false.
  2. If the SequenceConfigurationMode parameter is available on your camera model, set it to On.

序列集中包含什么?#

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

  • AcquisitionFrameRate
  • AcquisitionFrameRateEnable
  • BalanceRatio
  • BinningHorizontal
  • BinningVertical
  • BlackLevel
  • CenterX
  • CenterY
  • ChunkEnable
  • ChunkModeActive
  • ColorAdjustmentEnable
  • ColorAdjustmentHue
  • ColorAdjustmentSaturation
  • ColorTransformationMatrixFactor
  • ColorTransformationValue
  • DecimationVertical
  • DigitalShift
  • ExposureTime
  • Gain
  • Height
  • LUTEnable
  • OffsetX
  • OffsetX
  • PixelFormata
  • ProcessedRawEnable
  • ReverseX
  • ReverseYb
  • ScalingHorizontal
  • SequenceSetExecutionsc
  • StackedZoneImagingEnable
  • StackedZoneImagingZoneEnable
  • StackedZoneImagingZoneHeight
  • StackedZoneImagingZoneOffsetY
  • SubsamplingHorizontal
  • SyncUserOutput
  • TestImageSelector
  • TimerDelayd
  • TimerDelayTimebased
  • TimerDurationd
  • TimerDurationTimebased
  • Width

  1. 仅适用于以下相机型号:acA640-300gm/gc、acA800-200gm/gc、acA1300-75gm/gc、acA1920-48gm/gc、acA2500-20gm/gc。

  2. 不适用于以下相机型号:acA3088-16gm/gc、acA4024-8gm/gc、acA5472-5gm/gc。

  3. 仅在启用自动序列推进模式时包含。

  4. 可用于计时器 1。

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

信息

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

配置序列集#

信息

  • 要配置序列集,必须禁用定序器。
  • 断开相机电源后,对序列集所做的所有更改都会丢失。另外,定序器集也无法保存在用户设置集中。为了保留您的设置,Basler 建议您使用 pylon API 编写适当的代码,在每次打开相机电源时重新填充序列集。

在使用 Sequencer 功能之前,必须使用所需的设置填充序列集。每个序列集都有一个唯一的序列集索引编号,范围从 0 到 63。

要填充序列集:

  1. Set the SequenceSetTotalNumber parameter to the total number of sequence sets you want to use.
  2. 配置要存储在序列集 0 中的序列集参数
  3. 保存序列集 0。
  4. 对要使用的所有序列集重复步骤 2 和 3。确保始终使用从索引号 0 开始的连续索引号序列,例如,使用序列集 0、1、2 和 3。

示例:假设您需要两个序列集,并希望使用不同的图像 ROI 设置来填充它们。为此:

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

现在,您可以将定序器配置为在两个图像 ROI 之间快速切换。

保存序列集#

要保存序列集:

  1. Set the SequenceSetIndex parameter to the desired sequence set.
  2. Execute the SequenceSetStore command.

所有序列集参数的值都存储在所选序列集中。

加载序列集#

序列集在定序器运行期间自动加载。但是,手动加载序列集对于测试或在配置定序器时可能很有用。

若要手动加载序列集:

  1. Set the SequenceSetIndex parameter to the desired sequence set.
  2. Execute the SequenceSetLoad command.

所有序列集参数的值都将被覆盖,并由存储在所选序列集中的值替换。

配置 Sequencer#

配置序列集后,必须配置定序器。

信息

  • 要配置定序器,必须禁用定序器。
  • 断开相机电源后,对定序器配置所做的所有更改都将丢失。另外,定序器集也无法保存在用户设置集中。Basler 建议您使用 pylon API 编写适当的程序代码,在相机每次开启电源时重新配置相机。
  • 您可以使用 SequenceSetIndex 块来跟踪所使用的序列集。启用后,每个图像都包含块数据,该数据包括用于图像采集的序列集的索引号。

定序器可以三种模式运行,称为“推进模式”:

在所有模式下,序列集始终从序列集索引号 0 开始,以升序排列。

自动序列推进模式#

如果您希望配置连续重复的固定序列,此模式十分有用。

You can enable this mode by setting the SequenceAdvanceMode parameter to Auto.

在此模式下,当接收到帧开始触发信号时,会自动从一个序列集推进到下一个序列。

The SequenceSetTotalNumber parameter specifies the total number of sequence sets to be used. After the sequence set with the highest index number has been used, the cycle starts again at 0.

示例:假设您要配置以下序列循环:

示例序列循环:0-1-2-3-4-0-1-...

要配置上述序列循环:

  1. Set the SequenceAdvanceMode parameter to Auto.
  2. Set the SequenceSetTotalNumber parameter to 5.

多次使用序列集

(可选)每个序列集都可以连续使用多次。

要指定每个序列集要使用多少次:

  1. 加载所需的序列集。
  2. Configure the SequenceSetExecutions parameter for this sequence set. By default, the parameter is set to 1 for all sets which means that each sequence set is used once per cycle.
  3. 保存序列集。

示例:假设您要配置以下序列循环:

示例序列循环:0-1-1-1-2-3-4-5-5-0-1-...

要配置上述序列循环:

  1. Set the SequenceAdvanceMode parameter to Auto.
  2. Set the SequenceSetTotalNumber parameter to 6.
  3. Configure the SequenceSetExecutions parameter for each sequence set:

    • Sequence sets 0, 2, 3, and 4 are to be used only once per cycle. Therefore, you can skip these sets and leave the SequenceSetExecutions parameter at the default value of 1.
    • Sequence set 1 is to be used three times in a row. Load sequence set 1, set the SequenceSetExecutions parameter to 3, and save sequence set 1.
    • Sequence set 5 is to be used two times in a row. Load sequence set 5, set the SequenceSetExecutions parameter to 2, and save sequence set 5.

受控序列推进模式#

如果您希望配置可以通过Line 1 或软件命令控制的动态序列,此模式非常有用。

信息

  • 对于实时应用,Basler 强烈建议不要通过软件命令来控制定序器。发送软件命令与命令生效之间的延迟时间取决于特定的安装和网络上的当前负载。因此,无法预测在发送软件命令到该命令生效之间可能会发生多少次图像采集。
  • 使用Line 1 控制定序器时,务必牢记,在设置线路状态与帧开始触发信号上升之间需要 1 微秒的时间间隔。在帧开始触发信号上升后,还必须使线路状态保持至少 1 微秒。监视帧触发等待信号以优化时间安排。

You can enable this mode by setting the SequenceAdvanceMode parameter to Controlled.

与其他模式一样,推进始终从序列集索引编号 0 开始,按照升序进行。

但是,您可以控制以下内容:

  • 序列集推进:您希望定序器何时推进到下一个序列集?
  • 序列集重新启动:您希望序列循环何时从序列集 0 重新开始?

The SequenceSetTotalNumber parameter specifies the total number of sequence sets you want to use. After the sequence set with the highest index number has been used, the cycle starts again at 0.

配置序列集推进#

若要配置序列集推进:

  1. Set the SequenceControlSelector parameter to Advance.
  2. 设置 SequenceControlSource 参数设置为以下选项:
    • Line1: Sequence set advance will be controlled via line 1. If line 1 is low (0) while a frame start trigger signal is received, the sequencer does not advance and the current sequence set is used again for image acquisition. If line 1 is high (1) while a Frame Start trigger signal is received, the sequencer advances and the next sequence set in the cycle is used for image acquisition.
    • Disabled: Sequence set advance will be controlled using the SequenceAsyncAdvance software command. When this command is received, the sequencer advances without acquiring an image. When the next Frame Start trigger signal is received, the sequence set indicated by the SequenceCurrentSet parameter value is used for image acquisition.
    • AlwaysActive: The sequencer behaves as if Line1 was selected and line 1 was always high (1). As a result, the sequencer advances every time a frame start trigger signal is received. This way of operating the sequencer is similar to operating it in auto sequence advance mode when each sequence set is used only once per cycle. The only difference is that sequence set 1 is used as the first sequence set instead of sequence set 0.
配置序列集重启#

若要配置序列集重启:

  1. Set the SequenceControlSelector parameter to Restart.
  2. 设置 SequenceControlSource 参数设置为以下选项:
    • Line1: Sequence set restart will be controlled via line 1. If line 1 is low (0) while a frame start trigger signal is received, the next sequence set is used. If line 1 is high (1) while a Frame Start trigger signal is received, the sequence cycle is restarted and sequence set 0 is used.
    • Disabled: Sequence set restart will be controlled using the SequenceAsyncRestart software command. When this command is received, the sequence cycle is restarted without acquiring an image. When the next Frame Start trigger signal is received, sequence set 0 is used.

自由选择推进模式#

如果您希望在可自由选择的序列集之间快速切换,而无需遵守任何特定顺序,此模式十分有用。您使用相机的输入线路来决定序列。

信息

切记,在设置线路状态与帧开始触发信号上升之间需要 1 微秒的时间间隔。在帧开始触发信号上升后,您还必须使线路状态保持至少 1 微秒。监视帧触发等待信号以优化时间安排。

如何配置自由选择推进模式取决于相机上有多少输入线路可用:

具有一条输入线路的相机#

根据输入Line 1 的状态选择序列集:

  • 如果在接收到帧开始触发信号时Line 1 为低电平 (0),则将序列集 0 用于图像采集。
  • 如果在接收到帧开始触发信号时Line 1 为高电平 (1),则将序列集 1 用于图像采集。

仅序列集 0 和 1 可用。

要启用自由选择推进模式:

  1. Set the SequenceAdvanceMode parameter to FreeSelection.
  2. Set the SequenceSetTotalNumber parameter to 2.

The SequenceAddressBitSelector and SequenceAddressBitSource parameters also control the operation of the free selection advance mode. However, these parameters are preset and can't be changed.

具有两条输入线路的相机#

根据Line 1(光电耦合输入线路)和Line 3(GPIO 线路,必须配置为输入)的状态选择序列集,从而产生四种可能的组合。这使您可以在四个序列集之间进行选择。因此,只有序列集 0、1、2 和 3 可用。

为了配置自由选择推进模式,必须为每个线路分配一个“序列集地址位”。这些地址位的组合确定序列集索引号。下表显示了可能的组合及其各自的结果。

地址位 1 地址位 0 将要选择的序列集
0 0 序列集 0
0 1 序列集 1
1 0 序列集 2
1 1 序列集 3

例如,您可以将Line 1 分配给位 1,将Line 3 分配给位 0。这将得到以下示例配置:

  • 如果在接收到帧开始触发信号时,Line 1 为低电平 (0),Line 3 为低电平 (0),则将序列集 0 用于图像采集。
  • 如果在接收到帧开始触发信号时,Line 1 为低电平 (0),Line 3 为高电平 (1),则将序列集 1 用于图像采集。
  • 如果在接收到帧开始触发信号时,Line 1 为高电平 (1),Line 3 为低电平 (0),则将序列集 2 用于图像采集。
  • 如果在接收到帧开始触发信号时,Line 1 为高电平 (1),Line 3 为高电平 (1),则将序列集 3 用于图像采集。

要配置位并启用自由选择推进模式:

  1. Set the SequenceAdvanceMode parameter to FreeSelection.
  2. Set the SequenceSetTotalNumber parameter to 4.
  3. Set the SequenceAddressBitSelector parameter to Bit0.
  4. Set the SequenceAddressBitSource parameter to the line that you want to assign to bit 0, e.g., Line3.
  5. Set the SequenceAddressBitSelector parameter to Bit1.
  6. Set the SequenceAddressBitSource parameter to the line that you want to assign to bit 1, e.g., Line1.

信息

You can also use only one input line in free selection advance mode. To do so, set the SequenceSetTotalNumber parameter to 2. Now, only bit 0 is used to choose a sequence set. The free selection advance mode will behave as described under "Cameras with One Input Line".

时序图#

示例:自动序列推进模式#

自动序列推进模式时序图(示例)

示例:受控序列推进模式(通过Line 1 控制)#

受控序列推进模式时序图(示例)

示例:自由选择推进模式#

自由选择推进模式时序图(示例)

示例代码#

// ** Configuring sequence sets **
// Disable the sequencer during configuration
camera.SequenceEnable.SetValue(false);
// Enable configuration mode (available on selected cameras only)
camera.SequenceConfigurationMode.SetValue(SequenceConfigurationMode_On);
// Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.SetValue(2);
// Configure the parameters that you want to store in the first sequence set
camera.Width.SetValue(500);
camera.Height.SetValue(300);
// Select sequence set 0 and save the parameter values
camera.SequenceSetIndex.SetValue(0);
camera.SequenceSetStore.Execute();
// Configure the parameters that you want to store in the second sequence set
camera.Width.SetValue(800);
camera.Height.SetValue(600);
// Select sequence set 1 and save the parameter values
camera.SequenceSetIndex.SetValue(1);
camera.SequenceSetStore.Execute();
// ** Configuring the sequencer for auto sequence advance mode
// Assuming you want to configure the following sequence cycle:
// 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...) **
// Disable the sequencer during configuration
camera.SequenceEnable.SetValue(false);
camera.SequenceAdvanceMode.SetValue(SequenceAdvanceMode_Auto);
// Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.SetValue(2);
// Load sequence set 0 and specify that this set is to be used
// 2 times in a row
camera.SequenceSetIndex.SetValue(0);
camera.SequenceSetLoad.Execute();
camera.SequenceSetExecutions.SetValue(2);
camera.SequenceSetStore.Execute();
// Load sequence set 1 and specify that this set is to be used
// 3 times in a row
camera.SequenceSetIndex.SetValue(1);
camera.SequenceSetLoad.Execute();
camera.SequenceSetExecutions.SetValue(3);
camera.SequenceSetStore.Execute();
// Enable the sequencer
camera.SequenceEnable.SetValue(true);
// ** Configuring the sequencer for controlled sequence advance mode **
// Disable the sequencer during configuration
camera.SequenceEnable.SetValue(false);
camera.SequenceAdvanceMode.SetValue(SequenceAdvanceMode_Controlled);
// Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.SetValue(2);
// Specify that sequence set advance is controlled via line 1
camera.SequenceControlSelector.SetValue(SequenceControlSelector_Advance);
camera.SequenceControlSource.SetValue(SequenceControlSource_Line1);
// Specify that sequence set restart is controlled
// via software command
camera.SequenceControlSelector.SetValue(SequenceControlSelector_Restart);
camera.SequenceControlSource.SetValue(SequenceControlSource_Disabled);
// Enable the sequencer
camera.SequenceEnable.SetValue(true);
// Restart the sequencer via software command (for testing purposes)
camera.SequenceAsyncRestart.Execute();
// ** Configuring the sequencer for free selection advance mode
// on cameras with ONE input line **
// Disable the sequencer during configuration
camera.SequenceEnable.SetValue(false);
camera.SequenceAdvanceMode.SetValue(SequenceAdvanceMode_FreeSelection);
// Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.SetValue(2);
// Enable the sequencer
camera.SequenceEnable.SetValue(true);
// ** Configuring the sequencer for free selection advance mode
// on cameras with TWO input lines (1x opto-coupled, 1x GPIO set for input) **
// Disable the sequencer during configuration
camera.SequenceEnable.SetValue(false);
camera.SequenceAdvanceMode.SetValue(SequenceAdvanceMode_FreeSelection);
// Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.SetValue(4);
// Assign sequence address bit 0 to line 3
camera.SequenceAddressBitSelector.SetValue(SequenceAddressBitSelector_Bit0);
camera.SequenceAddressBitSource.SetValue(SequenceAddressBitSource_Line3);
// Assign sequence address bit 1 to line 1
camera.SequenceAddressBitSelector.SetValue(SequenceAddressBitSelector_Bit1);
camera.SequenceAddressBitSource.SetValue(SequenceAddressBitSource_Line1);
// Enable the sequencer
camera.SequenceEnable.SetValue(true);
INodeMap& nodemap = camera.GetNodeMap();
// ** Configuring sequence sets **
// Disable the sequencer during configuration
CBooleanParameter(nodemap, "SequenceEnable").SetValue(false);
// Enable configuration mode (available on selected cameras only)
CEnumParameter(nodemap, "SequenceConfigurationMode").SetValue("On");
// Set the total number of sequence sets to 2
CIntegerParameter(nodemap, "SequenceSetTotalNumber").SetValue(2);
// Configure the parameters that you want to store in the first sequence set
CIntegerParameter(nodemap, "Width").SetValue(500);
CIntegerParameter(nodemap, "Height").SetValue(300);
// Select sequence set 0 and save the parameter values
CIntegerParameter(nodemap, "SequenceSetIndex").SetValue(0);
CCommandParameter(nodemap, "SequenceSetStore").Execute();
// Configure the parameters that you want to store in the second sequence set
CIntegerParameter(nodemap, "Width").SetValue(800);
CIntegerParameter(nodemap, "Height").SetValue(600);
// Select sequence set 1 and save the parameter values
CIntegerParameter(nodemap, "SequenceSetIndex").SetValue(1);
CCommandParameter(nodemap, "SequenceSetStore").Execute();
// ** Configuring the sequencer for auto sequence advance mode
// Assuming you want to configure the following sequence cycle:
// 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...) **
// Disable the sequencer during configuration
CBooleanParameter(nodemap, "SequenceEnable").SetValue(false);
CEnumParameter(nodemap, "SequenceAdvanceMode").SetValue("Auto");
// Set the total number of sequence sets to 2
CIntegerParameter(nodemap, "SequenceSetTotalNumber").SetValue(2);
// Load sequence set 0 and specify that this set is to be used
// 2 times in a row
CIntegerParameter(nodemap, "SequenceSetIndex").SetValue(0);
CCommandParameter(nodemap, "SequenceSetLoad").Execute();
CIntegerParameter(nodemap, "SequenceSetExecutions").SetValue(2);
CCommandParameter(nodemap, "SequenceSetStore").Execute();
// Load sequence set 1 and specify that this set is to be used
// 3 times in a row
CIntegerParameter(nodemap, "SequenceSetIndex").SetValue(1);
CCommandParameter(nodemap, "SequenceSetLoad").Execute();
CIntegerParameter(nodemap, "SequenceSetExecutions").SetValue(3);
CCommandParameter(nodemap, "SequenceSetStore").Execute();
// Enable the sequencer
CBooleanParameter(nodemap, "SequenceEnable").SetValue(true);
// ** Configuring the sequencer for controlled sequence advance mode **
// Disable the sequencer during configuration
CBooleanParameter(nodemap, "SequenceEnable").SetValue(false);
CEnumParameter(nodemap, "SequenceAdvanceMode").SetValue("Controlled");
// Set the total number of sequence sets to 2
CIntegerParameter(nodemap, "SequenceSetTotalNumber").SetValue(2);
// Specify that sequence set advance is controlled via line 1
CEnumParameter(nodemap, "SequenceControlSelector").SetValue("Advance");
CEnumParameter(nodemap, "SequenceControlSource").SetValue("Line1");
// Specify that sequence set restart is controlled
// via software command
CEnumParameter(nodemap, "SequenceControlSelector").SetValue("Restart");
CEnumParameter(nodemap, "SequenceControlSource").SetValue("Disabled");
// Enable the sequencer
CBooleanParameter(nodemap, "SequenceEnable").SetValue(true);
// Restart the sequencer via software command (for testing purposes)
CCommandParameter(nodemap, "SequenceAsyncRestart").Execute();
// ** Configuring the sequencer for free selection advance mode
// on cameras with ONE input line **
// Disable the sequencer during configuration
CBooleanParameter(nodemap, "SequenceEnable").SetValue(false);
CEnumParameter(nodemap, "SequenceAdvanceMode").SetValue("FreeSelection");
// Set the total number of sequence sets to 2
CIntegerParameter(nodemap, "SequenceSetTotalNumber").SetValue(2);
// Enable the sequencer
CBooleanParameter(nodemap, "SequenceEnable").SetValue(true);
// ** Configuring the sequencer for free selection advance mode
// on cameras with TWO input lines (1x opto-coupled, 1x GPIO set for input) **
// Disable the sequencer during configuration
CBooleanParameter(nodemap, "SequenceEnable").SetValue(false);
CEnumParameter(nodemap, "SequenceAdvanceMode").SetValue("FreeSelection");
// Set the total number of sequence sets to 2
CIntegerParameter(nodemap, "SequenceSetTotalNumber").SetValue(4);
// Assign sequence address bit 0 to line 3
CEnumParameter(nodemap, "SequenceAddressBitSelector").SetValue("Bit0");
CEnumParameter(nodemap, "SequenceAddressBitSource").SetValue("Line3");
// Assign sequence address bit 1 to line 1
CEnumParameter(nodemap, "SequenceAddressBitSelector").SetValue("Bit1");
CEnumParameter(nodemap, "SequenceAddressBitSource").SetValue("Line1");
// Enable the sequencer
CBooleanParameter(nodemap, "SequenceEnable").SetValue(true);
// ** Configuring sequence sets **
// Disable the sequencer during configuration
camera.Parameters[PLCamera.SequenceEnable].SetValue(false);
// Enable configuration mode (available on selected cameras only)
camera.Parameters[PLCamera.SequenceConfigurationMode].SetValue(PLCamera.SequenceConfigurationMode.On);
// Set the total number of sequence sets to 2
camera.Parameters[PLCamera.SequenceSetTotalNumber].SetValue(2);
// Configure the parameters that you want to store in the first sequence set
camera.Parameters[PLCamera.Width].SetValue(500);
camera.Parameters[PLCamera.Height].SetValue(300);
// Select sequence set 0 and save the parameter values
camera.Parameters[PLCamera.SequenceSetIndex].SetValue(0);
camera.Parameters[PLCamera.SequenceSetStore].Execute();
// Configure the parameters that you want to store in the second sequence set
camera.Parameters[PLCamera.Width].SetValue(800);
camera.Parameters[PLCamera.Height].SetValue(600);
// Select sequence set 1 and save the parameter values
camera.Parameters[PLCamera.SequenceSetIndex].SetValue(1);
camera.Parameters[PLCamera.SequenceSetStore].Execute();
// ** Configuring the sequencer for auto sequence advance mode
// Assuming you want to configure the following sequence cycle:
// 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...) **
// Disable the sequencer during configuration
camera.Parameters[PLCamera.SequenceEnable].SetValue(false);
camera.Parameters[PLCamera.SequenceAdvanceMode].SetValue(PLCamera.SequenceAdvanceMode.Auto);
// Set the total number of sequence sets to 2
camera.Parameters[PLCamera.SequenceSetTotalNumber].SetValue(2);
// Load sequence set 0 and specify that this set is to be used
// 2 times in a row
camera.Parameters[PLCamera.SequenceSetIndex].SetValue(0);
camera.Parameters[PLCamera.SequenceSetLoad].Execute();
camera.Parameters[PLCamera.SequenceSetExecutions].SetValue(2);
camera.Parameters[PLCamera.SequenceSetStore].Execute();
// Load sequence set 1 and specify that this set is to be used
// 3 times in a row
camera.Parameters[PLCamera.SequenceSetIndex].SetValue(1);
camera.Parameters[PLCamera.SequenceSetLoad].Execute();
camera.Parameters[PLCamera.SequenceSetExecutions].SetValue(3);
camera.Parameters[PLCamera.SequenceSetStore].Execute();
// Enable the sequencer
camera.Parameters[PLCamera.SequenceEnable].SetValue(true);
// ** Configuring the sequencer for controlled sequence advance mode **
// Disable the sequencer during configuration
camera.Parameters[PLCamera.SequenceEnable].SetValue(false);
camera.Parameters[PLCamera.SequenceAdvanceMode].SetValue(PLCamera.SequenceAdvanceMode.Controlled);
// Set the total number of sequence sets to 2
camera.Parameters[PLCamera.SequenceSetTotalNumber].SetValue(2);
// Specify that sequence set advance is controlled via line 1
camera.Parameters[PLCamera.SequenceControlSelector].SetValue(PLCamera.SequenceControlSelector.Advance);
camera.Parameters[PLCamera.SequenceControlSource].SetValue(PLCamera.SequenceControlSource.Line1);
// Specify that sequence set restart is controlled
// via software command
camera.Parameters[PLCamera.SequenceControlSelector].SetValue(PLCamera.SequenceControlSelector.Restart);
camera.Parameters[PLCamera.SequenceControlSource].SetValue(PLCamera.SequenceControlSource.Disabled);
// Enable the sequencer
camera.Parameters[PLCamera.SequenceEnable].SetValue(true);
// Restart the sequencer via software command (for testing purposes)
camera.Parameters[PLCamera.SequenceAsyncRestart].Execute();
// ** Configuring the sequencer for free selection advance mode
// on cameras with ONE input line **
// Disable the sequencer during configuration
camera.Parameters[PLCamera.SequenceEnable].SetValue(false);
camera.Parameters[PLCamera.SequenceAdvanceMode].SetValue(PLCamera.SequenceAdvanceMode.FreeSelection);
// Set the total number of sequence sets to 2
camera.Parameters[PLCamera.SequenceSetTotalNumber].SetValue(2);
// Enable the sequencer
camera.Parameters[PLCamera.SequenceEnable].SetValue(true);
// ** Configuring the sequencer for free selection advance mode
// on cameras with TWO input lines (1x opto-coupled, 1x GPIO set for input) **
// Disable the sequencer during configuration
camera.Parameters[PLCamera.SequenceEnable].SetValue(false);
camera.Parameters[PLCamera.SequenceAdvanceMode].SetValue(PLCamera.SequenceAdvanceMode.FreeSelection);
// Set the total number of sequence sets to 2
camera.Parameters[PLCamera.SequenceSetTotalNumber].SetValue(4);
// Assign sequence address bit 0 to line 3
camera.Parameters[PLCamera.SequenceAddressBitSelector].SetValue(PLCamera.SequenceAddressBitSelector.Bit0);
camera.Parameters[PLCamera.SequenceAddressBitSource].SetValue(PLCamera.SequenceAddressBitSource.Line3);
// Assign sequence address bit 1 to line 1
camera.Parameters[PLCamera.SequenceAddressBitSelector].SetValue(PLCamera.SequenceAddressBitSelector.Bit1);
camera.Parameters[PLCamera.SequenceAddressBitSource].SetValue(PLCamera.SequenceAddressBitSource.Line1);
// Enable the sequencer
camera.Parameters[PLCamera.SequenceEnable].SetValue(true);
/* 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 */
/* ** Configuring sequence sets ** */
/* Disable the sequencer during configuration */
errRes = PylonDeviceSetBooleanFeature(hdev, "SequenceEnable", 0);
CHECK(errRes);
/* Enable configuration mode (available on selected cameras only) */
errRes = PylonDeviceFeatureFromString(hdev, "SequenceConfigurationMode", "On");
CHECK(errRes);
/* Set the total number of sequence sets to 2 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetTotalNumber", 2);
CHECK(errRes);
/* Configure the parameters that you want to store in the first sequence set */
errRes = PylonDeviceSetIntegerFeature(hdev, "Width", 500);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "Height", 300);
CHECK(errRes);
/* Select sequence set 0 and save the parameter values */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetIndex", 0);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequenceSetStore");
CHECK(errRes);
/* Configure the parameters that you want to store in the second sequence set */
errRes = PylonDeviceSetIntegerFeature(hdev, "Width", 800);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "Height", 600);
CHECK(errRes);
/* Select sequence set 1 and save the parameter values */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetIndex", 1);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequenceSetStore");
CHECK(errRes);
/* ** Configuring the sequencer for auto sequence advance mode */
/* Assuming you want to configure the following sequence cycle: */
/* 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...) ** */
/* Disable the sequencer during configuration */
errRes = PylonDeviceSetBooleanFeature(hdev, "SequenceEnable", 0);
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequenceAdvanceMode", "Auto");
CHECK(errRes);
/* Set the total number of sequence sets to 2 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetTotalNumber", 2);
CHECK(errRes);
/* Load sequence set 0 and specify that this set is to be used */
/* 2 times in a row */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetIndex", 0);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequenceSetLoad");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetExecutions", 2);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequenceSetStore");
CHECK(errRes);
/* Load sequence set 1 and specify that this set is to be used */
/* 3 times in a row */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetIndex", 1);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequenceSetLoad");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetExecutions", 3);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequenceSetStore");
CHECK(errRes);
/* Enable the sequencer */
errRes = PylonDeviceSetBooleanFeature(hdev, "SequenceEnable", 1);
CHECK(errRes);
/* ** Configuring the sequencer for controlled sequence advance mode ** */
/* Disable the sequencer during configuration */
errRes = PylonDeviceSetBooleanFeature(hdev, "SequenceEnable", 0);
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequenceAdvanceMode", "Controlled");
CHECK(errRes);
/* Set the total number of sequence sets to 2 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetTotalNumber", 2);
CHECK(errRes);
/* Specify that sequence set advance is controlled via line 1 */
errRes = PylonDeviceFeatureFromString(hdev, "SequenceControlSelector", "Advance");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequenceControlSource", "Line1");
CHECK(errRes);
/* Specify that sequence set restart is controlled */
/* via software command */
errRes = PylonDeviceFeatureFromString(hdev, "SequenceControlSelector", "Restart");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequenceControlSource", "Disabled");
CHECK(errRes);
/* Enable the sequencer */
errRes = PylonDeviceSetBooleanFeature(hdev, "SequenceEnable", 1);
CHECK(errRes);
/* Restart the sequencer via software command (for testing purposes) */
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequenceAsyncRestart");
CHECK(errRes);
/* ** Configuring the sequencer for free selection advance mode */
/* on cameras with ONE input line ** */
/* Disable the sequencer during configuration */
errRes = PylonDeviceSetBooleanFeature(hdev, "SequenceEnable", 0);
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequenceAdvanceMode", "FreeSelection");
CHECK(errRes);
/* Set the total number of sequence sets to 2 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetTotalNumber", 2);
CHECK(errRes);
/* Enable the sequencer */
errRes = PylonDeviceSetBooleanFeature(hdev, "SequenceEnable", 1);
CHECK(errRes);
/* ** Configuring the sequencer for free selection advance mode */
/* on cameras with TWO input lines (1x opto-coupled, 1x GPIO set for input) ** */
/* Disable the sequencer during configuration */
errRes = PylonDeviceSetBooleanFeature(hdev, "SequenceEnable", 0);
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequenceAdvanceMode", "FreeSelection");
CHECK(errRes);
/* Set the total number of sequence sets to 2 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequenceSetTotalNumber", 4);
CHECK(errRes);
/* Assign sequence address bit 0 to line 3 */
errRes = PylonDeviceFeatureFromString(hdev, "SequenceAddressBitSelector", "Bit0");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequenceAddressBitSource", "Line3");
CHECK(errRes);
/* Assign sequence address bit 1 to line 1 */
errRes = PylonDeviceFeatureFromString(hdev, "SequenceAddressBitSelector", "Bit1");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequenceAddressBitSource", "Line1");
CHECK(errRes);
/* Enable the sequencer */
errRes = PylonDeviceSetBooleanFeature(hdev, "SequenceEnable", 1);
CHECK(errRes);
# ** Configuring sequence sets **
# Disable the sequencer during configuration
camera.SequenceEnable.Value = False
# Enable configuration mode (available on selected cameras only)
camera.SequenceConfigurationMode.Value = "On"
# Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.Value = 2
# Configure the parameters that you want to store in the first sequence set
camera.Width.Value = 500
camera.Height.Value = 300
# Select sequence set 0 and save the parameter values
camera.SequenceSetIndex.Value = 0
camera.SequenceSetStore.Execute()
# Configure the parameters that you want to store in the second sequence set
camera.Width.Value = 800
camera.Height.Value = 600
# Select sequence set 1 and save the parameter values
camera.SequenceSetIndex.Value = 1
camera.SequenceSetStore.Execute()
# ** Configuring the sequencer for auto sequence advance mode
# Assuming you want to configure the following sequence cycle:
# 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...) **
# Disable the sequencer during configuration
camera.SequenceEnable.Value = False
camera.SequenceAdvanceMode.Value = "Auto"
# Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.Value = 2
# Load sequence set 0 and specify that this set is to be used
# 2 times in a row
camera.SequenceSetIndex.Value = 0
camera.SequenceSetLoad.Execute()
camera.SequenceSetExecutions.Value = 2
camera.SequenceSetStore.Execute()
# Load sequence set 1 and specify that this set is to be used
# 3 times in a row
camera.SequenceSetIndex.Value = 1
camera.SequenceSetLoad.Execute()
camera.SequenceSetExecutions.Value = 3
camera.SequenceSetStore.Execute()
# Enable the sequencer
camera.SequenceEnable.Value = True
# ** Configuring the sequencer for controlled sequence advance mode **
# Disable the sequencer during configuration
camera.SequenceEnable.Value = False
camera.SequenceAdvanceMode.Value = "Controlled"
# Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.Value = 2
# Specify that sequence set advance is controlled via line 1
camera.SequenceControlSelector.Value = "Advance"
camera.SequenceControlSource.Value = "Line1"
# Specify that sequence set restart is controlled
# via software command
camera.SequenceControlSelector.Value = "Restart"
camera.SequenceControlSource.Value = "Disabled"
# Enable the sequencer
camera.SequenceEnable.Value = True
# Restart the sequencer via software command (for testing purposes)
camera.SequenceAsyncRestart.Execute()
# ** Configuring the sequencer for free selection advance mode
# on cameras with ONE input line **
# Disable the sequencer during configuration
camera.SequenceEnable.Value = False
camera.SequenceAdvanceMode.Value = "FreeSelection"
# Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.Value = 2
# Enable the sequencer
camera.SequenceEnable.Value = True
# ** Configuring the sequencer for free selection advance mode
# on cameras with TWO input lines (1x opto-coupled, 1x GPIO set for input) **
# Disable the sequencer during configuration
camera.SequenceEnable.Value = False
camera.SequenceAdvanceMode.Value = "FreeSelection"
# Set the total number of sequence sets to 2
camera.SequenceSetTotalNumber.Value = 4
# Assign sequence address bit 0 to line 3
camera.SequenceAddressBitSelector.Value = "Bit0"
camera.SequenceAddressBitSource.Value = "Line3"
# Assign sequence address bit 1 to line 1
camera.SequenceAddressBitSelector.Value = "Bit1"
camera.SequenceAddressBitSource.Value = "Line1"
# Enable the sequencer
camera.SequenceEnable.Value = True

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