Sequencer (ace Classic/U/L USB)#
You can define up to 32 sets of parameter settings, called sequencer sets. As the camera acquires images, it applies one sequencer 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#
Sequencer Modes#
- In sequencer mode, the sequencer controls image acquisition. It can't be configured in this state.
- In sequencer configuration mode, the sequencer can be configured but is not controlling image acquisitions.
To enable the sequencer mode:
- Set all auto functions (e.g., Gain Auto, Exposure Auto) to
Off
. - Set the
SequencerMode
parameter toOn
.
To enable the sequencer configuration mode:
- Set the
SequencerMode
parameter toOff
. - Set the
SequencerConfigurationMode
parameter toOn
.
Info
On acA1920-25uc/um and acA2500-14uc/um cameras, when acquiring images using different sequencer sets, overlapping image acquisition is not possible. The camera must complete the entire exposure and readout process before a new sequence set can be loaded. As a consequence, the frame rate can be significantly reduced.
What's in a Sequencer Set?#
Sequencer sets contain the following parameters, if available:
AcquisitionFrameRate
AcquisitionFrameRateEnable
BalanceRatio
BinningHorizontal
BinningVertical
BlackLevel
CenterX
CenterY
ChunkEnable
ChunkModeActive
ColorAdjustmentHue
ColorAdjustmentSaturation
ColorTransformationValue
CounterDuration
(for Counter 2)CounterEventSource
CounterResetSource
DigitalShift
ExposureTime
Gain
Height
LUTEnable
aOffsetX
OffsetY
PixelFormat
bReverseX
ReverseY
cScalingHorizontal
SequencerSetNext
SequencerSetPath
SequencerSetSelector
SequencerSetStart
SequencerTriggerActivation
SequencerTriggerSource
TestImageSelector
TimerDelay
(for Timer 1)TimerDuration
(for Timer 1)Width
All other camera parameters can't be controlled using the Sequencer feature.
-
Only contained if the
Gamma
parameter is set to 1.0 and theLightSourcePreset
parameter is set toOff
. -
Only available for the following camera models: acA640-750um/uc, acA800-510um/uc, acA1300-200um/uc, acA1920-150um/uc, acA2500-60um/uc.
-
Not available for the following camera models: acA3088-57um/uc, acA4024-29um/uc, acA5472-17um/uc.
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.
Configuring Sequencer Sets#
Info
- To configure sequencer sets, the sequencer must be in configuration mode.
- All changes made to sequencer 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 sequencer sets with your desired settings. Each sequencer set has a unique sequencer set index number, ranging from 0 to 31.
To populate the sequencer sets:
- Configure the sequencer set parameters that you want to store in sequencer set 0.
- Save sequencer set 0.
- Repeat steps 1 and 2 for all sequencer sets you want to use. Make sure to always use a continuous series of index numbers starting with index number 0, e.g., use sequencer sets 0, 1, 2, and 3.
Example: Assume you need two sequencer sets and want to populate them with different image ROI settings. To do so:
- Create the first image ROI by adjusting the
Width
,Height
,OffsetX
, andOffsetY
parameter values. - Save sequencer set 0.
- Create the second image ROI by choosing different values for the
Width
,Height
,OffsetX
, andOffsetY
parameters. - Save sequencer set 1.
You can now configure the sequencer to quickly change between the two image ROIs.
Saving a Sequencer Set#
To save a sequencer set:
- Set the
SequencerSetSelector
parameter to the desired sequencer set. - Execute the
SequencerSetSave
command.
The values of all sequencer set parameters are stored in the selected sequencer set.
Loading a Sequencer Set#
Sequencer sets are loaded automatically during sequencer operation. However, loading a sequencer set manually can be useful for testing purposes or to set up the sequencer.
To manually load a sequencer set:
- Set the
SequencerSetSelector
parameter to the desired sequencer set. - Execute the
SequencerSetLoad
command.
The values of all sequencer set parameters are overwritten and replaced by the values stored in the selected sequencer set.
Configuring the Sequencer#
After you have configured the sequencer sets, you must set up the sequencer.
Info
- To configure the sequencer, the sequencer must be in configuration mode.
- 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 SequencerSetActive 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.
Path 0 and Path 1#
To control the sequencer, you must set up two so-called "paths":
-
Path 1 allows you to cycle through available sequencer sets (sequencer set advance). Whenever the sequencer receives a "path 1" trigger signal, the sequencer advances to the next set. Example:
-
Path 0 allows you to reset the cycle (sequencer set reset). Whenever the sequencer receives a "path 0" trigger signal, the sequencer restarts the cycle at sequencer set 0. Example:
Setting Up Path 0#
To set up path 0, you must specify the source signal that you want to use as the "path 0" trigger signal, i.e., as a sequencer set reset signal.
You can select hardware signals or software signals as source signals for path 0. The source setting must be stored in sequencer set 0.
To specify the source signal for path 0:
- Load sequencer set 0.
- Set the
SequencerPathSelector
parameter to 0. - Set the
SequencerTriggerSource
parameter to one of the following values:Line1
,Line3
, orLine4
: Sequencer set reset can be controlled via input line 1, GPIO line 3, or GPIO line 4.SoftwareSignal1
,SoftwareSignal2
, orSoftwareSignal3
: Sequencer set reset can be controlled using the Software Signal Pulse feature.
- Save sequencer set 0.
Info
- For real-time applications, Basler strongly recommends not to control sequencer set reset via software commands. Due to signal processing and transmission, there is an unspecified delay between issuing the software command and sequencer set reset. Accordingly, the number of image acquisitions that may occur between sending the software command and it becoming effective can't be predicted.
- Do not use the same trigger source for path 0 and path 1.
Setting Up Path 1#
Specifying the Trigger Source#
First, you must specify the source signal that you want to use as the "path 1" trigger signal, i.e., as a sequencer set advance signal.
You can select the Frame Start trigger signal, hardware signals, software signals, or a counter as source signals for path 1. The source setting must be stored in sequencer set 0.
To specify the source signal for path 1:
- Load sequencer set 0.
- Set the
SequencerPathSelector
parameter to 1. - Set the
SequencerTriggerSource
parameter to one of the following values:FrameStart
: Sequencer set advance occurs automatically as Frame Start trigger signals are received.Line1
,Line3
, orLine4
: Sequencer set advance can be controlled via input line 1, GPIO line 3, or GPIO line 4. To use one of the GPIO lines, the line must be configured for input. If the specified line is low (0) while a frame start trigger signal is received, the sequencer does not advance, and the current set is used again for image acquisition. If the line is high (1) while a Frame Start trigger signal is received, the sequencer advances, and the next sequencer set in the cycle is used for image acquisition.SoftwareSignal1
,SoftwareSignal2
, orSoftwareSignal3
: Sequencer set advance can be controlled using the Software Signal Pulse feature.Counter2End
: Sequencer set advance can be controlled using a counter.
- Save sequencer set 0.
Specifying the Sequencer Sets Used#
Second, you must specify which sequencer sets are to be used during sequencer operation.
By default, all 32 sequencer sets are used. As "path 1" trigger signals are received, the sequencer advances in ascending sequencer set index numbers from 0 to 31. After that, the cycle restarts at 0.
To use a lower number of sequencer sets:
-
Load the sequencer set with the highest index number to be used.
Example: Assume you have configured five sequencer sets, and you want to set up the following cycle:In this cycle, the highest sequencer set index number is 4. Therefore, load sequencer set 4. 2. Set the
SequencerPathSelector
parameter to 1. 3. Set theSequencerSetNext
parameter to 0. 4. Save the sequencer set.
During operation, the sequencer will now switch to sequencer set 0 after the set with the highest index number. This "closes the circle".
Info
- For real-time applications, Basler strongly recommends not to control sequencer set advance via software commands. Due to signal processing and transmission, there is an unspecified delay between issuing the software command and sequencer set advance. Accordingly, the number of image acquisitions that may occur between sending the software command and it becoming effective can't be predicted.
- Do not use the same trigger source for path 0 and path 1.
Using a Counter to Control the Sequencer#
If you set the source signal for path 1 to Counter2End
, you can use a counter to control sequencer set advance.
This is useful if you want to set up a fixed sequence that uses sequencer sets multiple times in a row.
For each sequencer set, you can set the CounterDuration
parameter to specify how many times the set is to be used in a row. By default, the parameter is set to 1 for all sets, and each sequence set is used once per cycle.
Example: Assume you want to set up the following sequencer set cycle:
To set up the above sequencer set cycle:
- Load sequencer set 0.
- Set the
SequencerPathSelector
parameter to 1. - Set the
SequencerTriggerSource
parameter toCounter2End
. - Save sequencer set 0.
- Set the
CounterSelector
parameter toCounter2
. -
Set the
CounterDuration
parameter for each sequencer set:- Sequencer sets 0, 2, 3, and 4 are to be used only once per cycle. Therefore, you can skip these sets and leave the
CounterDuration
parameter at the default value of 1. - Sequencer set 1 is to be used three times in a row. Load sequencer set 1, set the
CounterDuration
parameter to 3, and save sequencer set 1. - Sequencer set 5 is to be used two times in a row. Load sequencer set 5, set the
CounterDuration
parameter to 2, and save sequencer set 5.
- Sequencer sets 0, 2, 3, and 4 are to be used only once per cycle. Therefore, you can skip these sets and leave the
Additional Parameters#
The SequencerSetStart
and SequencerTriggerActivation
parameters also control the operation of the sequencer. However, these parameters are preset and can't be changed.
Sample Code#
// ** Configuring the sequencer sets **
// Enable sequencer configuration mode
camera.SequencerMode.SetValue(SequencerMode_Off);
camera.SequencerConfigurationMode.SetValue(SequencerConfigurationMode_On);
// Configure parameters to be stored in the first sequencer set
camera.Width.SetValue(600);
camera.Height.SetValue(300);
// Select sequencer set 0 and save the parameter values
camera.SequencerSetSelector.SetValue(0);
camera.SequencerSetSave.Execute();
// Configure parameters to be stored in the second sequencer set
camera.Width.SetValue(800);
camera.Height.SetValue(600);
// Select sequencer set 1 and save the parameter values
camera.SequencerSetSelector.SetValue(1);
camera.SequencerSetSave.Execute();
// Enable sequencer mode to operate the sequencer
camera.SequencerMode.SetValue(SequencerMode_On);
// ** Setting up path 0 **
// Enable sequencer configuration mode
camera.SequencerMode.SetValue(SequencerMode_Off);
camera.SequencerConfigurationMode.SetValue(SequencerConfigurationMode_On);
// Load sequencer set 0 and select path 0
camera.SequencerSetSelector.SetValue(0);
camera.SequencerSetLoad.Execute();
camera.SequencerPathSelector.SetValue(0);
// Set software signal 1 as "path 0" trigger signal
camera.SequencerTriggerSource.SetValue(SequencerTriggerSource_SoftwareSignal1);
// Save the changes
camera.SequencerSetSave.Execute();
// Enable sequencer mode to operate the sequencer
camera.SequencerMode.SetValue(SequencerMode_On);
// * Setting up path 1 **
// Enable sequencer configuration mode
camera.SequencerMode.SetValue(SequencerMode_Off);
camera.SequencerConfigurationMode.SetValue(SequencerConfigurationMode_On);
// Load sequencer set 0 and select path 1
camera.SequencerSetSelector.SetValue(0);
camera.SequencerSetLoad.Execute();
camera.SequencerPathSelector.SetValue(1);
// Set software signal 2 as "path 1" trigger signal
camera.SequencerTriggerSource.SetValue(SequencerTriggerSource_SoftwareSignal2);
// Save the changes
camera.SequencerSetSave.Execute();
// Assume you want to set up the following sequencer set cycle:
// 0 - 1 - 2 - 3 (- 0 - 1 - ...)
// Load the sequencer set with the highest index number to be used (here: 3)
camera.SequencerSetSelector.SetValue(3);
camera.SequencerSetLoad.Execute();
// Set the next sequencer set to 0 to "close the circle"
camera.SequencerPathSelector.SetValue(1);
camera.SequencerSetNext.SetValue(0);
// Save the changes
camera.SequencerSetSave.Execute();
// Enable sequencer mode to operate the sequencer
camera.SequencerMode.SetValue(SequencerMode_On);
// ** Advanced: Using a counter to control the sequencer **
// Enable sequencer configuration mode
camera.SequencerMode.SetValue(SequencerMode_Off);
camera.SequencerConfigurationMode.SetValue(SequencerConfigurationMode_On);
// Load sequencer set 0 and select path 1
camera.SequencerSetSelector.SetValue(0);
camera.SequencerSetLoad.Execute();
camera.SequencerPathSelector.SetValue(1);
// Set the Counter2 end event as "path 1" trigger signal
camera.SequencerTriggerSource.SetValue(SequencerTriggerSource_Counter2End);
// Save the changes
camera.SequencerSetSave.Execute();
// Select counter 2 to configure this counter
camera.CounterSelector.SetValue(CounterSelector_Counter2);
// Assume you want to set up the following sequencer set cycle:
// 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...)
// Load sequencer set 0 and specify that this set is to be used
// two times in a row
camera.SequencerSetSelector.SetValue(0);
camera.SequencerSetLoad.Execute();
camera.CounterDuration.SetValue(2);
camera.SequencerSetSave.Execute();
// Load sequencer set 1 and specify that this set is to be used
// three times in a row
camera.SequencerSetSelector.SetValue(1);
camera.SequencerSetLoad.Execute();
camera.CounterDuration.SetValue(3);
camera.SequencerSetSave.Execute();
// Enable sequencer mode to operate the sequencer
camera.SequencerMode.SetValue(SequencerMode_On);
INodeMap& nodemap = camera.GetNodeMap();
// ** Configuring the sequencer sets **
// Enable sequencer configuration mode
CEnumParameter(nodemap, "SequencerMode").SetValue("Off");
CEnumParameter(nodemap, "SequencerConfigurationMode").SetValue("On");
// Configure parameters to be stored in the first sequencer set
CIntegerParameter(nodemap, "Width").SetValue(600);
CIntegerParameter(nodemap, "Height").SetValue(300);
// Select sequencer set 0 and save the parameter values
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(0);
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Configure parameters to be stored in the second sequencer set
CIntegerParameter(nodemap, "Width").SetValue(800);
CIntegerParameter(nodemap, "Height").SetValue(600);
// Select sequencer set 1 and save the parameter values
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(1);
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Enable sequencer mode to operate the sequencer
CEnumParameter(nodemap, "SequencerMode").SetValue("On");
// ** Setting up path 0 **
// Enable sequencer configuration mode
CEnumParameter(nodemap, "SequencerMode").SetValue("Off");
CEnumParameter(nodemap, "SequencerConfigurationMode").SetValue("On");
// Load sequencer set 0 and select path 0
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(0);
CCommandParameter(nodemap, "SequencerSetLoad").Execute();
CIntegerParameter(nodemap, "SequencerPathSelector").SetValue(0);
// Set software signal 1 as "path 0" trigger signal
CEnumParameter(nodemap, "SequencerTriggerSource").SetValue("SoftwareSignal1");
// Save the changes
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Enable sequencer mode to operate the sequencer
CEnumParameter(nodemap, "SequencerMode").SetValue("On");
// * Setting up path 1 **
// Enable sequencer configuration mode
CEnumParameter(nodemap, "SequencerMode").SetValue("Off");
CEnumParameter(nodemap, "SequencerConfigurationMode").SetValue("On");
// Load sequencer set 0 and select path 1
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(0);
CCommandParameter(nodemap, "SequencerSetLoad").Execute();
CIntegerParameter(nodemap, "SequencerPathSelector").SetValue(1);
// Set software signal 2 as "path 1" trigger signal
CEnumParameter(nodemap, "SequencerTriggerSource").SetValue("SoftwareSignal2");
// Save the changes
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Assume you want to set up the following sequencer set cycle:
// 0 - 1 - 2 - 3 (- 0 - 1 - ...)
// Load the sequencer set with the highest index number to be used (here: 3)
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(3);
CCommandParameter(nodemap, "SequencerSetLoad").Execute();
// Set the next sequencer set to 0 to "close the circle"
CIntegerParameter(nodemap, "SequencerPathSelector").SetValue(1);
CIntegerParameter(nodemap, "SequencerSetNext").SetValue(0);
// Save the changes
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Enable sequencer mode to operate the sequencer
CEnumParameter(nodemap, "SequencerMode").SetValue("On");
// ** Advanced: Using a counter to control the sequencer **
// Enable sequencer configuration mode
CEnumParameter(nodemap, "SequencerMode").SetValue("Off");
CEnumParameter(nodemap, "SequencerConfigurationMode").SetValue("On");
// Load sequencer set 0 and select path 1
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(0);
CCommandParameter(nodemap, "SequencerSetLoad").Execute();
CIntegerParameter(nodemap, "SequencerPathSelector").SetValue(1);
// Set the Counter2 end event as "path 1" trigger signal
CEnumParameter(nodemap, "SequencerTriggerSource").SetValue("Counter2End");
// Save the changes
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Select counter 2 to configure this counter
CEnumParameter(nodemap, "CounterSelector").SetValue("Counter2");
// Assume you want to set up the following sequencer set cycle:
// 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...)
// Load sequencer set 0 and specify that this set is to be used
// two times in a row
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(0);
CCommandParameter(nodemap, "SequencerSetLoad").Execute();
CIntegerParameter(nodemap, "CounterDuration").SetValue(2);
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Load sequencer set 1 and specify that this set is to be used
// three times in a row
CIntegerParameter(nodemap, "SequencerSetSelector").SetValue(1);
CCommandParameter(nodemap, "SequencerSetLoad").Execute();
CIntegerParameter(nodemap, "CounterDuration").SetValue(3);
CCommandParameter(nodemap, "SequencerSetSave").Execute();
// Enable sequencer mode to operate the sequencer
CEnumParameter(nodemap, "SequencerMode").SetValue("On");
// ** Configuring the sequencer sets **
// Enable sequencer configuration mode
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.Off);
camera.Parameters[PLCamera.SequencerConfigurationMode].SetValue(PLCamera.SequencerConfigurationMode.On);
// Configure parameters to be stored in the first sequencer set
camera.Parameters[PLCamera.Width].SetValue(600);
camera.Parameters[PLCamera.Height].SetValue(300);
// Select sequencer set 0 and save the parameter values
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(0);
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Configure parameters to be stored in the second sequencer set
camera.Parameters[PLCamera.Width].SetValue(800);
camera.Parameters[PLCamera.Height].SetValue(600);
// Select sequencer set 1 and save the parameter values
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(1);
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Enable sequencer mode to operate the sequencer
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.On);
// ** Setting up path 0 **
// Enable sequencer configuration mode
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.Off);
camera.Parameters[PLCamera.SequencerConfigurationMode].SetValue(PLCamera.SequencerConfigurationMode.On);
// Load sequencer set 0 and select path 0
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(0);
camera.Parameters[PLCamera.SequencerSetLoad].Execute();
camera.Parameters[PLCamera.SequencerPathSelector].SetValue(0);
// Set software signal 1 as "path 0" trigger signal
camera.Parameters[PLCamera.SequencerTriggerSource].SetValue(PLCamera.SequencerTriggerSource.SoftwareSignal1);
// Save the changes
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Enable sequencer mode to operate the sequencer
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.On);
// * Setting up path 1 **
// Enable sequencer configuration mode
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.Off);
camera.Parameters[PLCamera.SequencerConfigurationMode].SetValue(PLCamera.SequencerConfigurationMode.On);
// Load sequencer set 0 and select path 1
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(0);
camera.Parameters[PLCamera.SequencerSetLoad].Execute();
camera.Parameters[PLCamera.SequencerPathSelector].SetValue(1);
// Set software signal 2 as "path 1" trigger signal
camera.Parameters[PLCamera.SequencerTriggerSource].SetValue(PLCamera.SequencerTriggerSource.SoftwareSignal2);
// Save the changes
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Assume you want to set up the following sequencer set cycle:
// 0 - 1 - 2 - 3 (- 0 - 1 - ...)
// Load the sequencer set with the highest index number to be used (here: 3)
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(3);
camera.Parameters[PLCamera.SequencerSetLoad].Execute();
// Set the next sequencer set to 0 to "close the circle"
camera.Parameters[PLCamera.SequencerPathSelector].SetValue(1);
camera.Parameters[PLCamera.SequencerSetNext].SetValue(0);
// Save the changes
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Enable sequencer mode to operate the sequencer
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.On);
// ** Advanced: Using a counter to control the sequencer **
// Enable sequencer configuration mode
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.Off);
camera.Parameters[PLCamera.SequencerConfigurationMode].SetValue(PLCamera.SequencerConfigurationMode.On);
// Load sequencer set 0 and select path 1
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(0);
camera.Parameters[PLCamera.SequencerSetLoad].Execute();
camera.Parameters[PLCamera.SequencerPathSelector].SetValue(1);
// Set the Counter2 end event as "path 1" trigger signal
camera.Parameters[PLCamera.SequencerTriggerSource].SetValue(PLCamera.SequencerTriggerSource.Counter2End);
// Save the changes
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Select counter 2 to configure this counter
camera.Parameters[PLCamera.CounterSelector].SetValue(PLCamera.CounterSelector.Counter2);
// Assume you want to set up the following sequencer set cycle:
// 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...)
// Load sequencer set 0 and specify that this set is to be used
// two times in a row
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(0);
camera.Parameters[PLCamera.SequencerSetLoad].Execute();
camera.Parameters[PLCamera.CounterDuration].SetValue(2);
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Load sequencer set 1 and specify that this set is to be used
// three times in a row
camera.Parameters[PLCamera.SequencerSetSelector].SetValue(1);
camera.Parameters[PLCamera.SequencerSetLoad].Execute();
camera.Parameters[PLCamera.CounterDuration].SetValue(3);
camera.Parameters[PLCamera.SequencerSetSave].Execute();
// Enable sequencer mode to operate the sequencer
camera.Parameters[PLCamera.SequencerMode].SetValue(PLCamera.SequencerMode.On);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK; /* Return value of pylon methods */
/* ** Configuring 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);
/* ** Setting up path 0 ** */
/* Enable sequencer configuration mode */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerMode", "Off");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequencerConfigurationMode", "On");
CHECK(errRes);
/* Load sequencer set 0 and select path 0 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 0);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetLoad");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerPathSelector", 0);
CHECK(errRes);
/* Set software signal 1 as "path 0" trigger signal */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerTriggerSource", "SoftwareSignal1");
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);
/* * Setting up path 1 ** */
/* Enable sequencer configuration mode */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerMode", "Off");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequencerConfigurationMode", "On");
CHECK(errRes);
/* Load sequencer set 0 and select path 1 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 0);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetLoad");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerPathSelector", 1);
CHECK(errRes);
/* Set software signal 2 as "path 1" trigger signal */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerTriggerSource", "SoftwareSignal2");
CHECK(errRes);
/* Save the changes */
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetSave");
CHECK(errRes);
/* Assume you want to set up the following sequencer set cycle: */
/* 0 - 1 - 2 - 3 (- 0 - 1 - ...) */
/* Load the sequencer set with the highest index number to be used (here: 3) */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 3);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetLoad");
CHECK(errRes);
/* Set the next sequencer set to 0 to "close the circle" */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerPathSelector", 1);
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetNext", 0);
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);
/* ** Advanced: Using a counter to control the sequencer ** */
/* Enable sequencer configuration mode */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerMode", "Off");
CHECK(errRes);
errRes = PylonDeviceFeatureFromString(hdev, "SequencerConfigurationMode", "On");
CHECK(errRes);
/* Load sequencer set 0 and select path 1 */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 0);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetLoad");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerPathSelector", 1);
CHECK(errRes);
/* Set the Counter2 end event as "path 1" trigger signal */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerTriggerSource", "Counter2End");
CHECK(errRes);
/* Save the changes */
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetSave");
CHECK(errRes);
/* Select counter 2 to configure this counter */
errRes = PylonDeviceFeatureFromString(hdev, "CounterSelector", "Counter2");
CHECK(errRes);
/* Assume you want to set up the following sequencer set cycle: */
/* 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...) */
/* Load sequencer set 0 and specify that this set is to be used */
/* two times in a row */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 0);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetLoad");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "CounterDuration", 2);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetSave");
CHECK(errRes);
/* Load sequencer set 1 and specify that this set is to be used */
/* three times in a row */
errRes = PylonDeviceSetIntegerFeature(hdev, "SequencerSetSelector", 1);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetLoad");
CHECK(errRes);
errRes = PylonDeviceSetIntegerFeature(hdev, "CounterDuration", 3);
CHECK(errRes);
errRes = PylonDeviceExecuteCommandFeature(hdev, "SequencerSetSave");
CHECK(errRes);
/* Enable sequencer mode to operate the sequencer */
errRes = PylonDeviceFeatureFromString(hdev, "SequencerMode", "On");
CHECK(errRes);
# ** Configuring the sequencer sets **
# Enable sequencer configuration mode
camera.SequencerMode.Value = "Off"
camera.SequencerConfigurationMode.Value = "On"
# Configure parameters to be stored in the first sequencer set
camera.Width.Value = 600
camera.Height.Value = 300
# Select sequencer set 0 and save the parameter values
camera.SequencerSetSelector.Value = 0
camera.SequencerSetSave.Execute()
# Configure parameters to be stored in the second sequencer set
camera.Width.Value = 800
camera.Height.Value = 600
# Select sequencer set 1 and save the parameter values
camera.SequencerSetSelector.Value = 1
camera.SequencerSetSave.Execute()
# Enable sequencer mode to operate the sequencer
camera.SequencerMode.Value = "On"
# ** Setting up path 0 **
# Enable sequencer configuration mode
camera.SequencerMode.Value = "Off"
camera.SequencerConfigurationMode.Value = "On"
# Load sequencer set 0 and select path 0
camera.SequencerSetSelector.Value = 0
camera.SequencerSetLoad.Execute()
camera.SequencerPathSelector.Value = 0
# Set software signal 1 as "path 0" trigger signal
camera.SequencerTriggerSource.Value = "SoftwareSignal1"
# Save the changes
camera.SequencerSetSave.Execute()
# Enable sequencer mode to operate the sequencer
camera.SequencerMode.Value = "On"
# * Setting up path 1 **
# Enable sequencer configuration mode
camera.SequencerMode.Value = "Off"
camera.SequencerConfigurationMode.Value = "On"
# Load sequencer set 0 and select path 1
camera.SequencerSetSelector.Value = 0
camera.SequencerSetLoad.Execute()
camera.SequencerPathSelector.Value = 1
# Set software signal 2 as "path 1" trigger signal
camera.SequencerTriggerSource.Value = "SoftwareSignal2"
# Save the changes
camera.SequencerSetSave.Execute()
# Assume you want to set up the following sequencer set cycle:
# 0 - 1 - 2 - 3 (- 0 - 1 - ...)
# Load the sequencer set with the highest index number to be used (here: 3)
camera.SequencerSetSelector.Value = 3
camera.SequencerSetLoad.Execute()
# Set the next sequencer set to 0 to "close the circle"
camera.SequencerPathSelector.Value = 1
camera.SequencerSetNext.Value = 0
# Save the changes
camera.SequencerSetSave.Execute()
# Enable sequencer mode to operate the sequencer
camera.SequencerMode.Value = "On"
# ** Advanced: Using a counter to control the sequencer **
# Enable sequencer configuration mode
camera.SequencerMode.Value = "Off"
camera.SequencerConfigurationMode.Value = "On"
# Load sequencer set 0 and select path 1
camera.SequencerSetSelector.Value = 0
camera.SequencerSetLoad.Execute()
camera.SequencerPathSelector.Value = 1
# Set the Counter2 end event as "path 1" trigger signal
camera.SequencerTriggerSource.Value = "Counter2End"
# Save the changes
camera.SequencerSetSave.Execute()
# Select counter 2 to configure this counter
camera.CounterSelector.Value = "Counter2"
# Assume you want to set up the following sequencer set cycle:
# 0 - 0 - 1 - 1 - 1 (- 0 - 0 - ...)
# Load sequencer set 0 and specify that this set is to be used
# two times in a row
camera.SequencerSetSelector.Value = 0
camera.SequencerSetLoad.Execute()
camera.CounterDuration.Value = 2
camera.SequencerSetSave.Execute()
# Load sequencer set 1 and specify that this set is to be used
# three times in a row
camera.SequencerSetSelector.Value = 1
camera.SequencerSetLoad.Execute()
camera.CounterDuration.Value = 3
camera.SequencerSetSave.Execute()
# Enable sequencer mode to operate the sequencer
camera.SequencerMode.Value = "On"
You can also use the pylon Viewer to easily set the parameters.