areaDetector / ADAravis

areaDetector driver for GenICam cameras using the Aravis library on Linux.
https://areadetector.github.io/areaDetector/ADAravis/ADAravis.html
6 stars 8 forks source link

Gain is not controllable with a Prosilica GC655C Camera #14

Closed JimboMonkey closed 3 years ago

JimboMonkey commented 3 years ago

Hello,

When using the ADAravis module with a Prosilica GC655C camera, all parameters work as expectedm with the exception of the gain. Changing the PV value has no effect on the image. No errors appear on the IOC console, and the camera continues to work without issue, but the gain value is ignored.

When using the aravisGigE module with the same camera, gain is controllable.

Thanks.

James

MarkRivers commented 3 years ago

I just tested ADAravis with an Allied Vision Technology Manta G507C and the gain is working fine. A couple of things to check.

image

Note that it has features called "GainSelector", "Gain", "GainRaw", and "GainAuto". I want to see what the features are called on your camera.

JimboMonkey commented 3 years ago

Good point! I hadn't checked these additional features. The camera is currently using the aravisGigE module, but I will test it again with ADAravis on Monday 10th May, and will check the parameters then.

MarkRivers commented 3 years ago

@JimboMonkey any progress on this? I am looking to make a new release of ADAravis soon.

JimboMonkey commented 3 years ago

Sorry I didn't get a chance to do my planned tests on the 10th. Diamond's next shutdown will start on Friday 21st May. That is now when I will test it again

JimboMonkey commented 3 years ago

Hi @MarkRivers - I finally revisited this again today.

The features screen has multiple gain settings available: Screenshot from 2021-05-28 16-19-31

What I've found is that if I change the gain on the CAM screen via the :Gain PV, although Gain_RBV updates, the gain of the image doesn't change. However, if I change the gain via the features screen by adjusting GC_GainRaw then the image gain does change as expected. This is with GainSelector set to 'All', and GainAuto set to 'Off' in both cases.

MarkRivers commented 3 years ago

I understand the problem. The Prosilica GC655C camera does not have a GenICam feature called Gain, it only has a feature called GainRaw. Many Prosilica/AVT cameras have both features, but this camera does not.

I just searched the ADGenICam/GenICamApp/Db for all camera template files that do not contain the string D_Gain, meaning they don't have a Gain feature.

corvette:ADGenICam/GenICamApp/Db>grep -L D_Gain *.template
...
AVT_GC1380CH.template
AVT_GC1380H.template
AVT_GE1050C.template
AVT_Prosilica_GC655C.template
Basler-acA1300-30gm.template
Basler-acA2000-50gmNIR.template
Basler-acA2040-35gm.template
Basler-acA2440-20gm.template
Basler-scA1300-32gm.template
Basler_piA640_210gm.template
Teledyne_ShadoBox.template

The ADGenICam driver should try to use the Gain feature if it is available, but if it is not then it should use the GainRaw feature. This is a bit tricky because Gain is a double feature but GainRaw is an integer feature.

I will work on this.

Meanwhile I would suggest you try loading the most recent firmware from Allied Vision and see if that fixes the problem. They may have added the Gain feature in more recent firmware.

MarkRivers commented 3 years ago

I have a GC1380H camera and it has the same problem. I just looked at the Allied Vision firmware release notes page: https://cdn.alliedvision.com/fileadmin/content/documents/products/software/firmware/Allied_Vision_GigE_Firmware_Release_Notes_34365.pdf

My GC1380H is running firmware version 1.50.01, which is the most recent version for that model. It is also the most recent version for your model, the GC650. So I don't think a firmware update to fix this is available, and I will need to fix the driver.

I see that aravisGigE does map the Gain PV to the GenICam Gain feature if it is available, and to the GainRaw feature if it is not. I will try to do the same thing for ADGenICam.

MarkRivers commented 3 years ago

I have modified ADGenICam so it maps the areaDetector ADGain parameter to the GenICam Gain feature if it is available, and to GainRaw or GainRawChannnelA if it is not. Gain is a GenICam double feature, but GainRaw and GainRawChannelA are GenICam integer features. This required some significant changes to ADGenICam.cpp and GenICamFeature.cpp to handle the conversion of integer and double data types.

I have tested the new version on the GC1380H camera using both ADVimba and ADAravis. The ADGain control now maps to the GainRaw GenICam feature on this camera, and works on both.

Note that the code change is in ADGenICam, not in ADVimba or ADAravis.

@JimboMonkey please test on the GC650 when you can.

JimboMonkey commented 3 years ago

Cool! Thanks @MarkRivers - that's great.

I will test out the change to ADGenICam asap and will let you know how it behaves with the GC655C

JimboMonkey commented 3 years ago

Hi @MarkRivers - I have tested the changes and can confirm that it has fixed the problem with the GC655C

Thank you very much for sorting this so quickly