User`s manual

Features AW00098504000
200 Basler ace Camera Link
Setting the Gain Auto Function Using Basler pylon
Setting the gain auto functionality using Basler pylon is a several step process:
Select the Auto Function AOI to which the Gain Auto function is assigned.
Set the value of the Offset X, Offset Y, Width, and Height parameters for the AOI.
Set the Gain Selector to All.
Set the value of the Auto Gain Raw Lower Limit and Auto Gain Raw Upper Limit parameters.
Set the value of the Auto Target Value parameter.
Set the value of the Gain Auto parameter for the "once" or the "continuous" mode of operation.
You can set the gain auto functionality from within your application software by using the pylon API.
The following code snippets illustrate using the API to set the exposure auto functionality:
// Select Auto Function AOI to which the Gain Auto function is assigned
// For this example, assume that the Gain Auto function is assigned
// to Auto AOI 1
Camera.AutoFunctionAOISelector.SetValue( AutoFunctionAOISelector_AOI1 );
// Set the position and size of selected auto function AOI. In this example, we set
// auto function AOI to cover the entire sensor.
Camera.AutoFunctionAOIOffsetX.SetValue( 0 );
Camera.AutoFunctionAOIOffsetY.SetValue( 0 );
Camera.AutoFunctionAOIWidth.SetValue( Camera.AutoFunctionAOIWidth.GetMax() );
Camera.AutoFunctionAOIHeight.SetValue( Camera.AutoFunctionAOIHeight.GetMax() );
// Select gain all and set the upper and lower gain limits for the gain
// auto function.
Camera.GainSelector.SetValue( GainSelector_All );
Camera.AutoGainRawLowerLimit.SetValue( Camera.GainRaw.GetMin() );
Camera.AutoGainRawUpperLimit.SetValue( Camera.GainRaw.GetMax() );
// Set target gray value for the gain auto function.
Camera.AutoTargetValue.SetValue( 16 );
// Set the mode of operation for gain auto function.
Camera.GainAuto.SetValue( GainAuto_Once );
You can also use the Basler pylon Viewer application to easily set the parameters.
For more information about the pylon API and the pylon Viewer, see Section 3.1 on page 19.