Sequencer (ace Classic/U/L GigE)#
您可以定义多达 64 组参数设置(称为序列集)。相机采集图像时,会逐个应用序列集。这使您可以快速更改相机参数,而不会影响最大帧速率。
例如,您可以使用 Sequencer 功能,在预配置的图像 ROI或曝光时间之间快速切换。
该功能的使用#
启用或禁用 Sequencer#
启用时,定序器将控制图像采集。无法在此状态下配置定序器。
禁用时,可以配置定序器,但定序器不控制图像采集。
要启用定序器:
- 全部设置为 自动功能 (例如, Gain Auto, Exposure Auto) 到
Off. - 设置
SequenceEnable参数至true.
禁用定序器:
- 设置
SequenceEnable参数至false. - 如果将
SequenceConfigurationMode参数在您的相机型号上可用,请将其设置为On.
序列集中包含什么?#
定序器集包含以下参数(如果可用):
AcquisitionFrameRateAcquisitionFrameRateEnableBalanceRatioBinningHorizontalBinningVerticalBlackLevelCenterXCenterYChunkEnableChunkModeActiveColorAdjustmentEnableColorAdjustmentHueColorAdjustmentSaturationColorTransformationMatrixFactorColorTransformationValueDecimationVerticalDigitalShiftExposureTimeGainHeightLUTEnableOffsetXOffsetXPixelFormataProcessedRawEnableReverseXReverseYbScalingHorizontalSequenceSetExecutionscStackedZoneImagingEnableStackedZoneImagingZoneEnableStackedZoneImagingZoneHeightStackedZoneImagingZoneOffsetYSubsamplingHorizontalSyncUserOutputTestImageSelectorTimerDelaydTimerDelayTimebasedTimerDurationdTimerDurationTimebasedWidth
-
仅适用于以下相机型号:acA640-300gm/gc、acA800-200gm/gc、acA1300-75gm/gc、acA1920-48gm/gc、acA2500-20gm/gc。
-
不适用于以下相机型号:acA3088-16gm/gc、acA4024-8gm/gc、acA5472-5gm/gc。
-
仅在启用自动序列推进模式时包含。
-
可用于计时器 1。
其他所有相机参数均无法使用 Sequencer 功能控制。
配置序列集#
信息
在使用 Sequencer 功能之前,必须使用所需的设置填充序列集。每个序列集都有一个唯一的序列集索引编号,范围从 0 到 63。
要填充序列集:
- 设置
SequenceSetTotalNumber参数设置为您要使用的 Sequencer 集总数。 - 配置要存储在序列集 0 中的序列集参数。
- 保存序列集 0。
- 对要使用的所有序列集重复步骤 2 和 3。确保始终使用从索引号 0 开始的连续索引号序列,例如,使用序列集 0、1、2 和 3。
示例:假设您需要两个序列集,并希望使用不同的图像 ROI 设置来填充它们。为此:
- 设置
SequenceSetTotalNumber参数设置为 2。 - 通过调整以下内容创建第一个 Image ROI:
Width,Height,OffsetX和OffsetY参数值。 - 保存序列集 0。
- 通过为以下参数选择不同的值来创建第二个 Image ROI:
Width,Height,OffsetX和OffsetYProperty。 - 保存序列集 1。
现在,您可以将定序器配置为在两个图像 ROI 之间快速切换。
保存序列集#
要保存序列集:
- 设置
SequenceSetIndex参数设置为所需的 Sequencer 集。 - 执行
SequenceSetStore命令。
所有序列集参数的值都存储在所选序列集中。
加载序列集#
序列集在定序器运行期间自动加载。但是,手动加载序列集对于测试或在配置定序器时可能很有用。
若要手动加载序列集:
- 设置
SequenceSetIndex参数设置为所需的 Sequencer 集。 - 执行
SequenceSetLoad命令。
所有序列集参数的值都将被覆盖,并由存储在所选序列集中的值替换。
配置 Sequencer#
配置序列集后,必须配置定序器。
信息
- 要配置定序器,必须禁用定序器。
- 断开相机电源后,对定序器配置所做的所有更改都将丢失。另外,定序器集也无法保存在用户设置集中。Basler 建议您使用 pylon API 编写适当的程序代码,在相机每次开启电源时重新配置相机。
- 您可以使用 SequenceSetIndex 块来跟踪所使用的序列集。启用后,每个图像都包含块数据,该数据包括用于图像采集的序列集的索引号。
定序器可以三种模式运行,称为“推进模式”:
在所有模式下,序列集始终从序列集索引号 0 开始,以升序排列。
自动序列推进模式#
如果您希望配置连续重复的固定序列,此模式十分有用。
您可以通过将 SequenceAdvanceMode 参数至 Auto.
在此模式下,当接收到帧开始触发信号时,会自动从一个序列集推进到下一个序列。
即: SequenceSetTotalNumber 参数指定要使用的 Sequencer 集总数。使用完索引号最高的 Sequencer 集后,循环将从 0 重新开始。
示例:假设您要配置以下序列循环:
要配置上述序列循环:
- 设置
SequenceAdvanceMode参数至Auto. - 设置
SequenceSetTotalNumber参数设置为 5。
多次使用序列集
(可选)每个序列集都可以连续使用多次。
要指定每个序列集要使用多少次:
- 加载所需的序列集。
- 配置
SequenceSetExecutions为此 Sequencer 集设置参数。默认情况下,所有集的该参数都设置为 1,这意味着每个 Sequencer 集在每个循环中被使用一次。 - 保存序列集。
示例:假设您要配置以下序列循环:
要配置上述序列循环:
- 设置
SequenceAdvanceMode参数至Auto. - 设置
SequenceSetTotalNumber参数设置为 6。 -
配置
SequenceSetExecutions为每个 Sequencer 集设置参数:
受控序列推进模式#
如果您希望配置可以通过Line 1 或软件命令控制的动态序列,此模式非常有用。
信息
- 对于实时应用,Basler 强烈建议不要通过软件命令来控制定序器。发送软件命令与命令生效之间的延迟时间取决于特定的安装和网络上的当前负载。因此,无法预测在发送软件命令到该命令生效之间可能会发生多少次图像采集。
- 使用Line 1 控制定序器时,务必牢记,在设置线路状态与帧开始触发信号上升之间需要 1 微秒的时间间隔。在帧开始触发信号上升后,还必须使线路状态保持至少 1 微秒。监视帧触发等待信号以优化时间安排。
您可以通过将 SequenceAdvanceMode 参数至 Controlled.
与其他模式一样,推进始终从序列集索引编号 0 开始,按照升序进行。
但是,您可以控制以下内容:
- 序列集推进:您希望定序器何时推进到下一个序列集?
- 序列集重新启动:您希望序列循环何时从序列集 0 重新开始?
即: SequenceSetTotalNumber 参数指定您要使用的 Sequencer 集总数。使用完索引号最高的 Sequencer 集后,循环将从 0 重新开始。
配置序列集推进#
若要配置序列集推进:
- 设置
SequenceControlSelector参数至Advance. - 设置
SequenceControlSource参数设置为以下选项:Line1:Sequencer 集切换将通过 Line 1 进行控制。如果在接收到 帧开始触发 信号时 Line 1 为低电平 (0),则 Sequencer 不会切换,且当前 Sequencer 集将再次用于图像采集。如果在接收到 Frame Start 触发信号时 Line 1 为高电平 (1),则 Sequencer 会切换,并且循环中的下一个 Sequencer 集将用于图像采集。Disabled:Sequencer 集切换将使用SequenceAsyncAdvance软件命令进行控制。接收到此命令后,Sequencer 会切换而不采集图像。接收到下一个 Frame Start 触发 信号时,将使用SequenceCurrentSet参数值指定的 Sequencer 集进行图像采集。AlwaysActive:Sequencer 的行为类似于Line1已被选中且 Line 1 始终保持高电平 (1)。因此,Sequencer 每次在 帧开始触发 收到信号。这种操作 Sequencer 的方式类似于在自动序列推进模式下操作,即每个序列集在每个周期仅使用一次。唯一的区别是,序列集 1 被用作第一个序列集,而不是序列集 0。
配置序列集重启#
若要配置序列集重启:
- 设置
SequenceControlSelector参数至Restart. - 设置
SequenceControlSource参数设置为以下选项:Line1: Sequencer 集重启将通过 Line 1 进行控制。如果在接收到 帧开始触发 信号时 Line 1 为低电平 (0),则使用下一个序列集。如果在接收到 Frame Start 触发信号时 Line 1 为高电平 (1),则会重新启动序列循环并使用序列集 0。Disabled: Sequencer 集重启将使用SequenceAsyncRestart软件命令进行控制。收到此命令后,将重新启动序列循环,而不采集图像。当收到下一个 Frame Start 触发 信号时,将使用序列集 0。
自由选择推进模式#
如果您希望在可自由选择的序列集之间快速切换,而无需遵守任何特定顺序,此模式十分有用。您使用相机的输入线路来决定序列。
信息
切记,在设置线路状态与帧开始触发信号上升之间需要 1 微秒的时间间隔。在帧开始触发信号上升后,您还必须使线路状态保持至少 1 微秒。监视帧触发等待信号以优化时间安排。
如何配置自由选择推进模式取决于相机上有多少输入线路可用:
具有一条输入线路的相机#
根据输入Line 1 的状态选择序列集:
- 如果在接收到帧开始触发信号时Line 1 为低电平 (0),则将序列集 0 用于图像采集。
- 如果在接收到帧开始触发信号时Line 1 为高电平 (1),则将序列集 1 用于图像采集。
仅序列集 0 和 1 可用。
要启用自由选择推进模式:
- 设置
SequenceAdvanceMode参数至FreeSelection. - 设置
SequenceSetTotalNumber参数设置为 2。
即: SequenceAddressBitSelector 和 SequenceAddressBitSource 参数还用于控制自由选择推进模式的操作。但是,这些参数是预设的,无法更改。
具有两条输入线路的相机#
根据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 用于图像采集。
要配置位并启用自由选择推进模式:
- 设置
SequenceAdvanceMode参数至FreeSelection. - 设置
SequenceSetTotalNumber参数设为 4。 - 设置
SequenceAddressBitSelector参数至Bit0. - 设置
SequenceAddressBitSource参数设为您要分配给位 0 的 Line,例如:Line3. - 设置
SequenceAddressBitSelector参数至Bit1. - 设置
SequenceAddressBitSource参数设为您要分配给位 1 的 Line,例如:Line1.
信息
您还可以在自由选择推进模式下仅使用一个输入 Line。为此,请将 SequenceSetTotalNumber 参数设为 2。现在,仅使用位 0 来选择序列集。自由选择推进模式的行为将如“具有一条输入线路的相机”中所述。
时序图#
示例:自动序列推进模式#
示例:受控序列推进模式(通过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 轻松设置参数。