Gain and exposure time are always adjusted together.
This feature is only available on Basler dart BCON for MIPI cameras.
To adjust gain or exposure time manually, use the Gain and Exposure Time features.
To enable or disable the automatic adjustments, set either the GainAuto parameter or the ExposureAuto parameter to one of the following operating modes:
When the camera is capturing images continuously, the auto function takes effect with a short delay. The first few images may not be affected by the auto function.
// Enable Gain/Exposure Auto
camera.GainAuto.SetValue(GainAuto_Continuous);
// This also enables Gain/Exposure Auto
camera.ExposureAuto.SetValue(ExposureAuto_Continuous);
INodeMap& nodemap = camera.GetNodeMap();
// Enable Gain/Exposure Auto
CEnumerationPtr(nodemap.GetNode("GainAuto"))->FromString("Continuous");
// This also enables Gain/Exposure Auto
CEnumerationPtr(nodemap.GetNode("ExposureAuto"))->FromString("Continuous");
// Enable Gain/Exposure Auto
camera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.Continuous);
// This also enables Gain/Exposure Auto
camera.Parameters[PLCamera.ExposureAuto].SetValue(PLCamera.ExposureAuto.Continuous);
// Enable Gain/Exposure Auto
Pylon.DeviceFeatureFromString(hdev, "GainAuto", "Continuous");
// This also enables Gain/Exposure Auto
Pylon.DeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
/* 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 */
/* Enable Gain/Exposure Auto */
errRes = PylonDeviceFeatureFromString(hdev, "GainAuto", "Continuous");
CHECK(errRes);
/* This also enables Gain/Exposure Auto */
errRes = PylonDeviceFeatureFromString(hdev, "ExposureAuto", "Continuous");
CHECK(errRes);
You can also use the pylon Viewer to easily set the parameters.