The Sequencer camera feature allows you to define sets of parameter settings and apply them to a sequence of images.
You can define up to 32 sets of parameter settings, called sequencer sets. As the camera receives trigger signals, it applies one sequencer set after the other.
For example, you can use the Sequencer feature to quickly change between preconfigured image ROIs or exposure times.
In configuration mode, some camera parameters may not be available, i.e., they are set to read-only. Check the Features - All pane in the pylon Viewer to find out which parameters are available.
To enable the sequencer mode, set the SequencerMode parameter to On. This automatically disables the sequencer configuration mode.
The sequencer is now ready to receive trigger signals and advance as configured.
Info
By default, when enabling the sequencer mode, the camera immediately loads sequencer set 0. To change this behavior, set the SequencerSetStart parameter to the desired start set.
In sequencer mode, some camera parameters may not be available, i.e., they are set to read-only. Check the Features - All pane in the pylon Viewer to find out which parameters are available.
In sequencer mode, some camera parameter values are calculated based on the sequencer sets configured:
The PayloadSize parameter value reflects the size of the largest sequencer set configured.
The maximum possible number of images in a burst of images, i.e., the maximum value of the AcquisitionFrameCount parameter, is calculated using the largest sequencer set configured.
You can use the SequencerSetActive parameter to find out which sequencer set is currently active.
If available, you can use the Sequencer Set Active chunk to keep track of the sequencer sets used. When enabled, each image contains chunk data including the index number of the sequencer set used for image acquisition.
When operating or configuring the sequencer, the exposure time mode is preset to Standard and can't be changed.
When operating or configuring the sequencer, the Multiple ROI feature is disabled.
All other camera parameters can't be controlled using the Sequencer feature.
Info
Loading or saving a sequencer 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.
Each sequencer set has a unique index number, ranging from 0 to 31. You can populate the sets with your desired camera settings (e.g., exposure time or image ROI).
To control the sequencer, you must define how and when the sequencer should advance from one set to the next.
For each sequencer set, you must define the following:
Criterion
Parameter
What should be the next set?
SequencerSetNext
On which trigger signal should the sequencer advance to the next set?
SequencerTriggerSource
When should the trigger signal be considered valid, e.g., on the rising or falling edge of the signal?
SequencerTriggerActivation
If required, you can define the above twice for each set, by configuring so-called paths. For example, you can define that the camera should advance to set 1 when a trigger signal on Line 3 is received (= path 0), but advance to set 3 when a trigger signal on Line 4 is received (= path 1).
When all this is set up, the camera knows exactly when and how to transition between the sequencer sets, essentially behaving like a state machine.
Sequencer Set Advance Is Independent of Frame Triggering
The sequencer can advance independently of image acquisition. Images are always acquired using the set that is the active set at the time the camera receives a frame trigger signal.
For example, you can trigger sequencer set advance using input line 3, but trigger images using line 4.
If you want to synchronize sequencer advance with image acquisition, Basler recommends setting the sequencer trigger source to ExposureStart.
Do not set the sequencer and frame start trigger source to the same signal source. Otherwise, the camera may show unpredictable behavior.
Set the SequencerSetSelector parameter to the first sequencer set to be configured.
Execute the SequencerSetLoad command.
Configure sequencer set advance for path 0:
Set the SequencerPathSelector parameter to 0.
Set the SequencerSetNext parameter to the next set to be configured.
Set the SequencerTriggerSource parameter to the source signal that should be used to advance to the next set. You can select any of the available trigger source signals, e.g., Line1 or ExposureStart.
If you selected a trigger source that can be high (1) or low (0), i.e., an I/O signal, set the SequencerTriggerActivation parameter to one of the following values:
RisingEdge (default): The sequencer advances when the source signal rises, i.e., when the signal status changes from low to high.
FallingEdge: The sequencer advances when the source signal falls, i.e., when the signal status changes from high to low.
AnyEdge: The sequencer advances when the source signal falls or rises.
LevelHigh: The sequencer advances when the source signal is high. If the signal is already high when the sequencer set is loaded, the sequencer immediately advances to the next set. This happens independently of image acquisition.
LevelLow: The sequencer advances when the source signal is low. If the signal is already low when the sequencer set is loaded, the sequencer immediately advances to the next set. This happens independently of image acquisition.
If you want to define a second condition on which you want the camera to advance to a different set, repeat step 4 with the SequencerPathSelector parameter set to 1.
Execute the SequencerSetSave command.
Set the SequencerSetSelector parameter to the next sequencer set to be configured.
Assume you want to cycle through sequencer sets 0, 1, and 2 during image acquisition. Whenever the camera acquires an image, the sequencer should advance to the next set.
To achieve this, set up the sequencer as follows:
Sequencer Set Selector
Sequencer Path Selector
Sequencer Trigger Source
Sequencer Trigger Activation
Sequencer Set Next
0
0
ExposureStart
-
1
1
0
ExposureStart
-
2
2
0
ExposureStart
-
0
The following outlines what happens if you set up the sequencer as shown above:
When enabled, the sequencer starts with set 0 (default) and waits for the exposure of the first image.
When that happens, the camera applies the current sequencer set 0 to the image and then advances to set 1.
When the next exposure starts, the camera applies set 1 and advances to set 2.
When the next exposure starts, the camera applies set 2 and advances to set 0.
Now, the sequencer has returned to set 0, and the process described above repeats.
You can set up the sequencer to advance to a specific set on every nth image acquisition.
This involves using the Counter feature and configuring multiple paths.
Assume you want to alternate between sequencer sets 0 and 1 during image acquisition, but for the first and every 10th image, sequencer set 2 should be used.
Make sure the counter is reset before you start image acquisition. Otherwise, it won't count.
In the configuration above, note that the counter is triggered using Exposure Start signals, while sequencer set advance is triggered using Exposure Active signals with falling edge activation. This helps to avoid timing conflicts between path 0 and path 1.
The following outlines what happens if you set up the sequencer as shown above:
When enabled, the sequencer starts with set 2 and waits for the exposure of the first image.
When the first exposure starts, Counter 1 increases from 0 to 1, because it is configured to count Exposure Start events.
When the first exposure ends, i.e., when the Exposure Active signal falls, the sequencer advances to set 0.
For the next 8 image acquisitions, the sequencer alternates between sets 0 and 1 and the counter continues to increase. The sequencer advances whenever an exposure ends, i.e., when the Exposure Active signal falls.
When the exposure of the 10th image starts, the counter reaches its maximum value (CounterDuration = 10), resets itself, and the camera sends a Counter 1 End signal. This makes the sequencer advance to set 2 on path 1 before the path 0 trigger condition (ExposureActive, FallingEdge) becomes valid.
Now, the sequencer has returned to set 2, and the process described above repeats.
You can set up the sequencer to select sequencer sets at runtime as required.
This involves configuring multiple I/O lines as trigger sources and using the LevelLow and LevelHigh options of the SequencerTriggerActivation parameter.
Assume you want to control sequencer set selection using the signal status (0 = low, 1 = high) of input lines 2 and 3. Depending on the lines' statuses, you want the sequencer to operate as follows:
Signal Status Line 2
Signal Status Line 3
Selected Set
0
0
0
0
1
1
1
0
2
1
1
3
To achieve this, set up the sequencer as follows:
Sequencer Set Selector
Sequencer Path Selector
Sequencer Trigger Source
Sequencer Trigger Activation
Sequencer Set Next
0
0
Line3
LineHigh
1
0
1
Line2
LineHigh
2
1
0
Line3
LineLow
0
1
1
Line2
LineHigh
3
2
0
Line3
LineHigh
3
2
1
Line2
LineLow
0
3
0
Line3
LineLow
2
3
1
Line2
LineLow
1
The following outlines what happens if you set up the sequencer as shown above:
As long as both signals are low, the triggers on Line 2 and Line 3 stay inactive, because their trigger activation is set to LineHigh. See table rows 1 and 2. Therefore, the sequencer remains at set 0.
When the signal on Line 3 rises, the LineHigh activation occurs, and the sequencer immediately advances from set 0 to set 1. See table row 1. Then, the sequencer remains at set 1, because Line 2 is still low.
When the signal on Line 2 also rises, the sequencer advances from set 1 to set 3. See table row 4.
When the signal on Line 2 falls, the sequencer advances back to set 1. See table row 8.
When the signal on Line 3 also falls, the sequencer advances back to set 0. See table row 3.
Info
This also works if you change the I/O signal on both lines at the same time, e.g., by switching the statuses of both I/O lines from high to low.
Image acquisition must be triggered separately. The sequencer may advance multiple times between frames when the I/O line status changes.
// ** Populating the Sequencer Sets **// Enable sequencer configuration modecamera.SequencerMode.SetValue(SequencerMode_Off);camera.SequencerConfigurationMode.SetValue(SequencerConfigurationMode_On);// Configure parameters to be stored in the first sequencer setcamera.Width.SetValue(600);camera.Height.SetValue(300);// Select sequencer set 0 and save the parameter valuescamera.SequencerSetSelector.SetValue(0);camera.SequencerSetSave.Execute();// Configure parameters to be stored in the second sequencer setcamera.Width.SetValue(800);camera.Height.SetValue(600);// Select sequencer set 1 and save the parameter valuescamera.SequencerSetSelector.SetValue(1);camera.SequencerSetSave.Execute();// Enable sequencer mode to operate the sequencercamera.SequencerMode.SetValue(SequencerMode_On);// ** Configuring sequencer set advance **// Assume you want to alternate between sequencer sets 0 and 1 using input line 3// Enable sequencer configuration modecamera.SequencerMode.SetValue(SequencerMode_Off);camera.SequencerConfigurationMode.SetValue(SequencerConfigurationMode_On);// Set the start set to set 0camera.SequencerSetStart.SetValue(0);// Load and configure sequencer set 0camera.SequencerSetSelector.SetValue(0);camera.SequencerSetLoad.Execute();camera.SequencerPathSelector.SetValue(0);camera.SequencerSetNext.SetValue(1);camera.SequencerTriggerSource.SetValue(SequencerTriggerSource_Line3);camera.SequencerTriggerActivation.SetValue(SequencerTriggerActivation_RisingEdge);// Save the changescamera.SequencerSetSave.Execute();// Load and configure sequencer set 1camera.SequencerSetSelector.SetValue(1);camera.SequencerSetLoad.Execute();camera.SequencerPathSelector.SetValue(0);camera.SequencerSetNext.SetValue(2);camera.SequencerTriggerSource.SetValue(SequencerTriggerSource_Line3);camera.SequencerTriggerActivation.SetValue(SequencerTriggerActivation_RisingEdge);// Save the changescamera.SequencerSetSave.Execute();// Enable sequencer mode to operate the sequencercamera.SequencerMode.SetValue(SequencerMode_On);
INodeMap&nodemap=camera.GetNodeMap();// ** Populating the Sequencer Sets **// Enable sequencer configuration modeCEnumParameter(nodemap,"SequencerMode").SetValue("Off");CEnumParameter(nodemap,"SequencerConfigurationMode").SetValue("On");// Configure parameters to be stored in the first sequencer setCIntegerParameter(nodemap,"Width").SetValue(600);CIntegerParameter(nodemap,"Height").SetValue(300);// Select sequencer set 0 and save the parameter valuesCIntegerParameter(nodemap,"SequencerSetSelector").SetValue(0);CCommandParameter(nodemap,"SequencerSetSave").Execute();// Configure parameters to be stored in the second sequencer setCIntegerParameter(nodemap,"Width").SetValue(800);CIntegerParameter(nodemap,"Height").SetValue(600);// Select sequencer set 1 and save the parameter valuesCIntegerParameter(nodemap,"SequencerSetSelector").SetValue(1);CCommandParameter(nodemap,"SequencerSetSave").Execute();// Enable sequencer mode to operate the sequencerCEnumParameter(nodemap,"SequencerMode").SetValue("On");// ** Configuring sequencer set advance **// Assume you want to alternate between sequencer sets 0 and 1 using input line 3// Enable sequencer configuration modeCEnumParameter(nodemap,"SequencerMode").SetValue("Off");CEnumParameter(nodemap,"SequencerConfigurationMode").SetValue("On");// Set the start set to set 0CIntegerParameter(nodemap,"SequencerSetStart").SetValue(0);// Load and configure sequencer set 0CIntegerParameter(nodemap,"SequencerSetSelector").SetValue(0);CCommandParameter(nodemap,"SequencerSetLoad").Execute();CIntegerParameter(nodemap,"SequencerPathSelector").SetValue(0);CIntegerParameter(nodemap,"SequencerSetNext").SetValue(1);CEnumParameter(nodemap,"SequencerTriggerSource").SetValue("Line3");CEnumParameter(nodemap,"SequencerTriggerActivation").SetValue("RisingEdge");// Save the changesCCommandParameter(nodemap,"SequencerSetSave").Execute();// Load and configure sequencer set 1CIntegerParameter(nodemap,"SequencerSetSelector").SetValue(1);CCommandParameter(nodemap,"SequencerSetLoad").Execute();CIntegerParameter(nodemap,"SequencerPathSelector").SetValue(0);CIntegerParameter(nodemap,"SequencerSetNext").SetValue(2);CEnumParameter(nodemap,"SequencerTriggerSource").SetValue("Line3");CEnumParameter(nodemap,"SequencerTriggerActivation").SetValue("RisingEdge");// Save the changesCCommandParameter(nodemap,"SequencerSetSave").Execute();// Enable sequencer mode to operate the sequencerCEnumParameter(nodemap,"SequencerMode").SetValue("On");
// ** Populating the Sequencer Sets **// Enable sequencer configuration modecamera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.Off);camera.Parameters[PLCamera.SequencerConfigurationMode].SetValue(PLCamera.SequencerConfigurationMode.On);// Configure parameters to be stored in the first sequencer setcamera.Parameters[PLCamera.Width].SetValue(600);camera.Parameters[PLCamera.Height].SetValue(300);// Select sequencer set 0 and save the parameter valuescamera.Parameters[PLCamera.SequencerSetSelector].SetValue(0);camera.Parameters[PLCamera.SequencerSetSave].Execute();// Configure parameters to be stored in the second sequencer setcamera.Parameters[PLCamera.Width].SetValue(800);camera.Parameters[PLCamera.Height].SetValue(600);// Select sequencer set 1 and save the parameter valuescamera.Parameters[PLCamera.SequencerSetSelector].SetValue(1);camera.Parameters[PLCamera.SequencerSetSave].Execute();// Enable sequencer mode to operate the sequencercamera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.On);// ** Configuring sequencer set advance **// Assume you want to alternate between sequencer sets 0 and 1 using input line 3// Enable sequencer configuration modecamera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.Off);camera.Parameters[PLCamera.SequencerConfigurationMode].SetValue(PLCamera.SequencerConfigurationMode.On);// Set the start set to set 0camera.Parameters[PLCamera.SequencerSetStart].SetValue(0);// Load and configure sequencer set 0camera.Parameters[PLCamera.SequencerSetSelector].SetValue(0);camera.Parameters[PLCamera.SequencerSetLoad].Execute();camera.Parameters[PLCamera.SequencerPathSelector].SetValue(0);camera.Parameters[PLCamera.SequencerSetNext].SetValue(1);camera.Parameters[PLCamera.SequencerTriggerSource].SetValue(PLCamera.SequencerTriggerSource.Line3);camera.Parameters[PLCamera.SequencerTriggerActivation].SetValue(PLCamera.SequencerTriggerActivation.RisingEdge);// Save the changescamera.Parameters[PLCamera.SequencerSetSave].Execute();// Load and configure sequencer set 1camera.Parameters[PLCamera.SequencerSetSelector].SetValue(1);camera.Parameters[PLCamera.SequencerSetLoad].Execute();camera.Parameters[PLCamera.SequencerPathSelector].SetValue(0);camera.Parameters[PLCamera.SequencerSetNext].SetValue(2);camera.Parameters[PLCamera.SequencerTriggerSource].SetValue(PLCamera.SequencerTriggerSource.Line3);camera.Parameters[PLCamera.SequencerTriggerActivation].SetValue(PLCamera.SequencerTriggerActivation.RisingEdge);// Save the changescamera.Parameters[PLCamera.SequencerSetSave].Execute();// Enable sequencer mode to operate the sequencercamera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.On);
/* Macro to check for errors */#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)GENAPIC_RESULTerrRes=GENAPI_E_OK;/* Return value of pylon methods *//* ** Populating the Sequencer Sets ** *//* Enable sequencer configuration mode */errRes=PylonDeviceFeatureFromString(hdev,"SequencerMode","Off");CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"SequencerConfigurationMode","On");CHECK(errRes);/* Configure parameters to be stored in the first sequencer set */errRes=PylonDeviceSetIntegerFeature(hdev,"Width",600);CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"Height",300);CHECK(errRes);/* Select sequencer set 0 and save the parameter values */errRes=PylonDeviceSetIntegerFeature(hdev,"SequencerSetSelector",0);CHECK(errRes);errRes=PylonDeviceExecuteCommandFeature(hdev,"SequencerSetSave");CHECK(errRes);/* Configure parameters to be stored in the second sequencer set */errRes=PylonDeviceSetIntegerFeature(hdev,"Width",800);CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"Height",600);CHECK(errRes);/* Select sequencer set 1 and save the parameter values */errRes=PylonDeviceSetIntegerFeature(hdev,"SequencerSetSelector",1);CHECK(errRes);errRes=PylonDeviceExecuteCommandFeature(hdev,"SequencerSetSave");CHECK(errRes);/* Enable sequencer mode to operate the sequencer */errRes=PylonDeviceFeatureFromString(hdev,"SequencerMode","On");CHECK(errRes);/* ** Configuring sequencer set advance ** *//* Assume you want to alternate between sequencer sets 0 and 1 using input line 3 *//* Enable sequencer configuration mode */errRes=PylonDeviceFeatureFromString(hdev,"SequencerMode","Off");CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"SequencerConfigurationMode","On");CHECK(errRes);/* Set the start set to set 0 */errRes=PylonDeviceSetIntegerFeature(hdev,"SequencerSetStart",0);CHECK(errRes);/* Load and configure sequencer set 0 */errRes=PylonDeviceSetIntegerFeature(hdev,"SequencerSetSelector",0);CHECK(errRes);errRes=PylonDeviceExecuteCommandFeature(hdev,"SequencerSetLoad");CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"SequencerPathSelector",0);CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"SequencerSetNext",1);CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"SequencerTriggerSource","Line3");CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"SequencerTriggerActivation","RisingEdge");CHECK(errRes);/* Save the changes */errRes=PylonDeviceExecuteCommandFeature(hdev,"SequencerSetSave");CHECK(errRes);/* Load and configure sequencer set 1 */errRes=PylonDeviceSetIntegerFeature(hdev,"SequencerSetSelector",1);CHECK(errRes);errRes=PylonDeviceExecuteCommandFeature(hdev,"SequencerSetLoad");CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"SequencerPathSelector",0);CHECK(errRes);errRes=PylonDeviceSetIntegerFeature(hdev,"SequencerSetNext",2);CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"SequencerTriggerSource","Line3");CHECK(errRes);errRes=PylonDeviceFeatureFromString(hdev,"SequencerTriggerActivation","RisingEdge");CHECK(errRes);/* Save the changes */errRes=PylonDeviceExecuteCommandFeature(hdev,"SequencerSetSave");CHECK(errRes);/* Enable sequencer mode to operate the sequencer */errRes=PylonDeviceFeatureFromString(hdev,"SequencerMode","On");CHECK(errRes);
# ** Populating the Sequencer Sets **# Enable sequencer configuration modecamera.SequencerMode.Value="Off"camera.SequencerConfigurationMode.Value="On"# Configure parameters to be stored in the first sequencer setcamera.Width.Value=600camera.Height.Value=300# Select sequencer set 0 and save the parameter valuescamera.SequencerSetSelector.Value=0camera.SequencerSetSave.Execute()# Configure parameters to be stored in the second sequencer setcamera.Width.Value=800camera.Height.Value=600# Select sequencer set 1 and save the parameter valuescamera.SequencerSetSelector.Value=1camera.SequencerSetSave.Execute()# Enable sequencer mode to operate the sequencercamera.SequencerMode.Value="On"# ** Configuring sequencer set advance **# Assume you want to alternate between sequencer sets 0 and 1 using input line 3# Enable sequencer configuration modecamera.SequencerMode.Value="Off"camera.SequencerConfigurationMode.Value="On"# Set the start set to set 0camera.SequencerSetStart.Value=0# Load and configure sequencer set 0camera.SequencerSetSelector.Value=0camera.SequencerSetLoad.Execute()camera.SequencerPathSelector.Value=0camera.SequencerSetNext.Value=1camera.SequencerTriggerSource.Value="Line3"camera.SequencerTriggerActivation.Value="RisingEdge"# Save the changescamera.SequencerSetSave.Execute()# Load and configure sequencer set 1camera.SequencerSetSelector.Value=1camera.SequencerSetLoad.Execute()camera.SequencerPathSelector.Value=0camera.SequencerSetNext.Value=2camera.SequencerTriggerSource.Value="Line3"camera.SequencerTriggerActivation.Value="RisingEdge"# Save the changescamera.SequencerSetSave.Execute()# Enable sequencer mode to operate the sequencercamera.SequencerMode.Value="On"