// Set the the Gain Auto auto function to its maximum upper limitdoublemaxUpperLimit=camera.AutoGainUpperLimit.GetMax();camera.AutoGainUpperLimit.SetValue(maxUpperLimit);// Specify the target valuecamera.AutoTargetBrightness.SetValue(0.6);// Enable Gain Auto by setting the operating mode to Continuouscamera.GainAuto.SetValue(GainAuto_Continuous);
INodeMap&nodemap=camera.GetNodeMap();// Set the the Gain Auto auto function to its maximum upper limitdoublemaxUpperLimit=CFloatParameter(nodemap,"AutoGainUpperLimit").GetMax();CFloatParameter(nodemap,"AutoGainUpperLimit").SetValue(maxUpperLimit);// Specify the target valueCFloatParameter(nodemap,"AutoTargetBrightness").SetValue(0.6);// Enable Gain Auto by setting the operating mode to ContinuousCEnumParameter(nodemap,"GainAuto").SetValue("Continuous");
// Set the the Gain Auto auto function to its maximum upper limitdoublemaxUpperLimit=camera.Parameters[PLCamera.AutoGainUpperLimit].GetMaximum();camera.Parameters[PLCamera.AutoGainUpperLimit].SetValue(maxUpperLimit);// Specify the target valuecamera.Parameters[PLCamera.AutoTargetBrightness].SetValue(0.6);// Enable Gain Auto by setting the operating mode to Continuouscamera.Parameters[PLCamera.GainAuto].SetValue(PLCamera.GainAuto.Continuous);
/* 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 */doublemaxUpperLimit=0;/* Set the the Gain Auto auto function to its maximum upper limit */errRes=PylonDeviceGetFloatFeatureMax(hdev,"AutoGainUpperLimit",&maxUpperLimit);CHECK(errRes);errRes=PylonDeviceSetFloatFeature(hdev,"AutoGainUpperLimit",maxUpperLimit);CHECK(errRes);/* Specify the target value */errRes=PylonDeviceSetFloatFeature(hdev,"AutoTargetBrightness",0.6);CHECK(errRes);/* Enable Gain Auto by setting the operating mode to Continuous */errRes=PylonDeviceFeatureFromString(hdev,"GainAuto","Continuous");CHECK(errRes);
# Set the the Gain Auto auto function to its maximum upper limitmaxUpperLimit=camera.AutoGainUpperLimit.Maxcamera.AutoGainUpperLimit.Value=maxUpperLimit# Specify the target valuecamera.AutoTargetBrightness.Value=0.6# Enable Gain Auto by setting the operating mode to Continuouscamera.GainAuto.Value="Continuous"
You can also use the pylon Viewer to easily set the parameters.