Sequencer (ace Classic/U/L GigE)#
You can define up to 64 sets of parameter settings, called sequence sets. As the camera acquires images, it applies one sequence set after the other. This enables you to quickly change camera parameters without compromising the maximum frame rate.
For example, you can use the Sequencer feature to quickly change between preconfigured image ROIs or exposure times.
Using the Feature#
Enabling or Disabling the Sequencer#
When enabled, the sequencer controls image acquisitions. It can't be configured in this state.
When disabled, the sequencer can be configured but is not controlling image acquisitions.
To enable the sequencer:
- Set all auto functions (e.g., Gain Auto, Exposure Auto) to
Off
. - Set the
SequenceEnable
parameter totrue
.
To disable the sequencer:
- Set the
SequenceEnable
parameter tofalse
. - If the
SequenceConfigurationMode
parameter is available on your camera model, set it toOn
.
What's in a Sequence Set?#
Sequencer sets contain the following parameters, if available:
AcquisitionFrameRate
AcquisitionFrameRateEnable
BalanceRatio
BinningHorizontal
BinningVertical
BlackLevel
CenterX
CenterY
ChunkEnable
ChunkModeActive
ColorAdjustmentEnable
ColorAdjustmentHue
ColorAdjustmentSaturation
ColorTransformationMatrixFactor
ColorTransformationValue
DecimationVertical
DigitalShift
ExposureTime
Gain
Height
LUTEnable
OffsetX
OffsetX
PixelFormat
aProcessedRawEnable
ReverseX
ReverseY
bScalingHorizontal
SequenceSetExecutions
cStackedZoneImagingEnable
StackedZoneImagingZoneEnable
StackedZoneImagingZoneHeight
StackedZoneImagingZoneOffsetY
SubsamplingHorizontal
SyncUserOutput
TestImageSelector
TimerDelay
dTimerDelayTimebase
dTimerDuration
dTimerDurationTimebase
dWidth
-
Only available for the following camera models: acA640-300gm/gc, acA800-200gm/gc, acA1300-75gm/gc, acA1920-48gm/gc, acA2500-20gm/gc.
-
Not available for the following camera models: acA3088-16gm/gc, acA4024-8gm/gc, acA5472-5gm/gc.
-
Only contained if the auto sequence advance mode is enabled.
-
Available for Timer 1.
All other camera parameters can't be controlled using the Sequencer feature.
Info
Loading or saving a sequence set will always load or save all of the above parameters, even those you haven't changed. For example, if you only changed the exposure time and left all other parameters at their default values, the values of all other parameters will also be stored – and overwritten on load.
Configuring Sequence Sets#
Info
- To configure sequence sets, the sequencer must be disabled.
- All changes made to sequence sets are lost when the camera is disconnected from power. Also, sequencer settings can't be saved in a user set. In order to preserve your settings, Basler recommends that you write suitable program code using the pylon API to re-populate the sequence sets every time the camera is powered on.
Before you can use the Sequencer feature, you must populate the sequence sets with your desired settings. Each sequence set has a unique sequence set index number, ranging from 0 to 63.
To populate the sequence sets:
- Set the
SequenceSetTotalNumber
parameter to the total number of sequence sets you want to use. - Configure the sequence set parameters that you want to store in sequence set 0.
- Save sequence set 0.
- Repeat steps 2 and 3 for all sequence sets you want to use. Make sure to always use a continuous series of index numbers starting with index number 0, e.g., use sequence sets 0, 1, 2, and 3.
Example: Assume you need two sequence sets and want to populate them with different image ROI settings. To do so:
- Set the
SequenceSetTotalNumber
parameter to 2. - Create the first image ROI by adjusting the
Width
,Height
,OffsetX
, andOffsetY
parameter values. - Save sequence set 0.
- Create the second image ROI by choosing different values for the
Width
,Height
,OffsetX
, andOffsetY
parameters. - Save sequence set 1.
You can now configure the sequencer to quickly change between the two image ROIs.
Saving a Sequence Set#
To save a sequence set:
- Set the
SequenceSetIndex
parameter to the desired sequence set. - Execute the
SequenceSetStore
command.
The values of all sequence set parameters are stored in the selected sequence set.
Loading a Sequence Set#
Sequence sets are loaded automatically during sequencer operation. However, loading a sequence set manually can be useful for testing purposes or when configuring the sequencer.
To manually load a sequence set:
- Set the
SequenceSetIndex
parameter to the desired sequence set. - Execute the
SequenceSetLoad
command.
The values of all sequence set parameters are overwritten and replaced by the values stored in the selected sequence set.
Configuring the Sequencer#
After you have configured the sequence sets, you must configure the sequencer.
Info
- To configure the sequencer, the sequencer must be disabled.
- All changes made to the sequencer configuration are lost when the camera is disconnected from power. Also, sequencer settings can't be saved in a user set. Basler recommends that you write suitable program code using the pylon API to reconfigure the camera every time it is powered on.
- You can use the SequenceSetIndex chunk to keep track of the sequence sets used. When enabled, each image contains chunk data including the index number of the sequence set used for image acquisition.
The sequencer can be operated in three modes, called "advance modes":
In all modes, sequence sets always advance in ascending order, starting from sequence set index number 0.
Auto Sequence Advance Mode#
This mode is useful if you want to configure a fixed sequence which is repeated continuously.
You can enable this mode by setting the SequenceAdvanceMode
parameter to Auto
.
In this mode, the advance from one sequence set to the next occurs automatically as Frame Start trigger signals are received.
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.
Example: Assume you want to configure the following sequence cycle:
To configure the above sequence cycle:
- Set the
SequenceAdvanceMode
parameter toAuto
. - Set the
SequenceSetTotalNumber
parameter to 5.
Using Sequence Sets Multiple Times
Optionally, each sequence set can be used several times in a row.
To specify how many times you want to use each sequence set:
- Load the desired sequence set.
- 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. - Save the sequence set.
Example: Assume you want to configure the following sequence cycle:
To configure the above sequence cycle:
- Set the
SequenceAdvanceMode
parameter toAuto
. - Set the
SequenceSetTotalNumber
parameter to 6. -
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.
- Sequence sets 0, 2, 3, and 4 are to be used only once per cycle. Therefore, you can skip these sets and leave the
Controlled Sequence Advance Mode#
This mode is useful if you want to configure a dynamic sequence which can be controlled via line 1 or software commands.
Info
- For real-time applications, Basler strongly recommends not to control the sequencer via software commands. The delay between sending a software command and it becoming effective depends on the specific installation and the current load on the network. Therefore, it's impossible to predict how many image acquisitions may occur between sending the software command and it becoming effective.
- When you're controlling the sequencer using line 1, you have to bear in mind that it takes one microsecond between setting the status of the line and the rise of the Frame Start trigger signal. You also have to maintain the status of the line for at least one microsecond after the Frame Start trigger signal has risen. Monitor the Frame Trigger Wait signal to optimize the timing.
You can enable this mode by setting the SequenceAdvanceMode
parameter to Controlled
.
As in the other modes, the advance always proceeds in ascending order, starting from sequence set index number 0.
You can, however, control the following:
- Sequence set advance: When do you want the sequencer to advance to the next sequence set?
- Sequence set restart: When do you want the sequence cycle to start again from sequence set 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.
Configuring Sequence Set Advance#
To configure sequence set advance:
- Set the
SequenceControlSelector
parameter toAdvance
. - Set the
SequenceControlSource
parameter to one of the following options: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 theSequenceAsyncAdvance
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 theSequenceCurrentSet
parameter value is used for image acquisition.AlwaysActive
: The sequencer behaves as ifLine1
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.
Configuring Sequence Set Restart#
To configure sequence set restart:
- Set the
SequenceControlSelector
parameter toRestart
. - Set the
SequenceControlSource
parameter to one of the following options: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 theSequenceAsyncRestart
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.
Free Selection Advance Mode#
This mode is useful if you want to quickly change between freely selectable sequence sets without having to observe any particular order. You use the input lines of your camera to determine the sequence.
Info
Bear in mind that it takes one microsecond between setting the status of the line and the rise of the Frame Start trigger signal. You also have to maintain the status of the line for at least one microsecond after the Frame Start trigger signal has risen. Monitor the Frame Trigger Wait signal to optimize the timing.
How to configure free selection advance mode depends on how many input lines are available on your camera:
Cameras with One Input Line#
Sequence sets are chosen according to the status of input line 1:
- If line 1 is low (0) while a frame start trigger signal is received, sequence set 0 is used for image acquisition.
- If line 1 is high (1) while a Frame Start trigger signal is received, sequence set 1 is used for image acquisition.
Only sequence sets 0 and 1 are available.
To enable free selection advance mode:
- Set the
SequenceAdvanceMode
parameter toFreeSelection
. - 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.
Cameras with Two Input Lines#
Sequence sets are chosen according to the status of line 1 (opto-coupled input line) and line 3 (GPIO line, must be configured as input), resulting in four possible combinations. This allows you to choose between four sequence sets. Consequently, only sequence sets 0, 1, 2, and 3 are available.
In order to configure the free selection advance mode, you must assign a "sequence set address bit" to each line. The combinations of these address bits determine the sequence set index number. The following table shows the possible combinations and their respective outcomes.
Address Bit 1 | Address Bit 0 | Sequence Set That Will Be Selected |
---|---|---|
0 | 0 | Sequence set 0 |
0 | 1 | Sequence set 1 |
1 | 0 | Sequence set 2 |
1 | 1 | Sequence set 3 |
For example, you can assign line 1 to bit 1 and line 3 to bit 0. This results in the following sample configuration:
- If line 1 is low (0) and line 3 is low (0) while a frame start trigger signal is received, sequence set 0 is used for image acquisition.
- If line 1 is low (0) and line 3 is high (1) while a frame start trigger signal is received, sequence set 1 is used for image acquisition.
- If line 1 is high (1) and line 3 is low (0) while a frame start trigger signal is received, sequence set 2 is used for image acquisition.
- If line 1 is high (1) and line 3 is high (1) while a frame start trigger signal is received, sequence set 3 is used for image acquisition.
To configure the bits and enable free selection advance mode:
- Set the
SequenceAdvanceMode
parameter toFreeSelection
. - Set the
SequenceSetTotalNumber
parameter to 4. - Set the
SequenceAddressBitSelector
parameter toBit0
. - Set the
SequenceAddressBitSource
parameter to the line that you want to assign to bit 0, e.g.,Line3
. - Set the
SequenceAddressBitSelector
parameter toBit1
. - Set the
SequenceAddressBitSource
parameter to the line that you want to assign to bit 1, e.g.,Line1
.
Info
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".
Timing Diagrams#
Example: Auto Sequence Advance Mode#
Example: Controlled Sequence Advance Mode (Controlled via Line 1)#
Example: Free Selection Advance Mode#
Sample Code#
// ** 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
You can also use the pylon Viewer to easily set the parameters.