areaDetector / ADGenICam

areaDetector base class for GenICam cameras.
https://areadetector.github.io/master/ADGenICam/ADGenICam.html
7 stars 16 forks source link

Can ADGenICam automatically set limits for PVs that have pMin and pMax fields #21

Closed jwlodek closed 3 years ago

jwlodek commented 3 years ago

I know certain GenICam parameters have set min and max values, and I was wondering if the database files generated by ADGenICam support assigning limits to the PV values entered for these parameters, and if it doesn't yet, would it be possible?

I believe these min/max values are listed as pMin and pMax tags in the xml: https://github.com/areaDetector/ADGenICam/blob/3b6b7e800c08a695e662f63f9ec7fc28a95a9794/xml/Basler-scA1300-32gm.xml#L78

MarkRivers commented 3 years ago

I was wondering if the database files generated by ADGenICam support assigning limits to the PV values entered for these parameters,

I am not sure what you are asking. The pMin and pMax are Inq features, in other words they can be queried, but not set. Are you asking if the database can set the DRVL and DRVH values of the Gain PV based on the pMin and pMax values in the XML file?

If so, then the answer is no. The problem is that the min and max values can be dynamic. For example the maximum frame rate almost always depends on whether the camera is running in 8-bit, 12-bit, or 16-bit mode. The XML file does not encode that. As far as I know there is no a-priori way to determine whether the min and max values in the XML file always apply, or can change depending on the value of some other feature.

The ADGenICam driver currently reads the min and max values every time a feature value is changed. It clips to the min and max, and the actual value is shown in the RBV record. It would be possible to add new read-only PVs that show the current value of the min and max. However, that would occupy quite a bit of real estate in the OPI display.

Perhaps I did not understand your question?

jwlodek commented 3 years ago

Hi Mark,

thanks for the answer, that's pretty much what I was asking - I hadn't considered that these min/max values are variable based on the camera operating mode. I don't think having min/max PVs for each field is reasonable just because as you said it would take up too much space on the Control Screen.

I think the current behavior is probably best - straightforward and doesn't require any changes.