Hi Mark,
Ad 1: Need to read/set enum string value of mbbo/mbbi record, instead of .VAL field within ADDriver.
VAL field is read/set with setIntegerParam() and getIntegerParam(), and I am looking for equivalent function for mbbo enum, if they exist.
================
Looking for equivalent to setting/reading enum using caget/caput (instead of setting mbbo .VAL to 2), like below:
setting mbbo:
```
gofron@HP/base/bin/linux-x86_64$ ./caput TPX3-TEST:cam1:TriggerMode "PEXSTART_NEXSTOP"
Old : TPX3-TEST:cam1:TriggerMode AUTOTRIGSTART_TIMERSTOP
New : TPX3-TEST:cam1:TriggerMode PEXSTART_NEXSTOP
```
or reading enum string of mbbo record:
```
kgofron@kgofron-HP-Z6-G4-Workstation:/epics/src/RHEL8/base/bin/linux-x86_64$ ./caget TPX3-TEST:cam1:TriggerMode
TPX3-TEST:cam1:TriggerMode PEXSTART_NEXSTOP
```
================
The mbbo record is defined:
record(mbbo, "$(P)$(R)TriggerMode")
{
field(ZRST, "PEXSTART_NEXSTOP")
field(ZRVL, "0")
field(ONST, "NEXSTART_PEXSTOP")
field(ONVL, "1")
field(TWST, "PEXSTART_TIMERSTOP")
field(TWVL, "2")
field(THST, "NEXSTART_TIMERSTOP")
field(THVL, "3")
field(FRST, "AUTOTRIGSTART_TIMERSTOP")
field(FRVL, "4")
field(FVST, "CONTINUOUS")
field(FVVL, "5")
field(SXST, "SOFTWARESTART_TIMERSTOP")
field(SXVL, "6")
field(SVST, "SOFTWARESTART_TIMERSTOP")
field(SVVL, "7")
}
Thanks for looking into this,
Kaz
From: Mark Rivers <rivers at cars.uchicago.edu>
Sent: Wednesday, July 6, 2022 4:13 PM
To: Gofron, Kazimierz <kgofron at bnl.gov>
Cc: tech-talk <tech-talk at aps.anl.gov>
Subject: RE: Set/get enum value of mbbo from within AD driver
Hi Kaz,
Ø
Is there a way to set/get enum string value of mbbo/mbbi record from within areaDetector driver?
I want to be clear about what you are asking. Are you asking whether an areaDetector driver can
1)
Select the mbbi value using a string (rather than a number)?
or
2)
Change the string and/or integer value associated with a particular enum index?
It is not currently possible to do 1), you can only select by number, not by string.
It is possible to do 2). That is done with the asynEnum interface. You implement methods that override one or more of these asynPortDriver methods:
-
readEnum
-
writeEnum
-
doCallbacksEnum
This is used in many areaDetector drivers so that they can populate the enum strings and values with appropriate values for a particular detector model. These are some of the drivers that implement readEnum() to set enum strings and
values:
-
andor3.cpp
-
andorCCD.cpp
-
ADGenICam.cpp
-
GenICamFeature.cpp
-
arvFeature.cpp
-
ADVimba.cpp
-
VimbaFeature.cpp
Mark
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Gofron, Kazimierz via Tech-talk
Sent: Wednesday, July 6, 2022 2:43 PM
To: tech-talk at aps.anl.gov
Subject: Set/get enum value of mbbo from within AD driver
Is there a way to set/get enum string value of mbbo/mbbi record from within areaDetector driver?
I can set/get Enum values using caput/caget, but setIntegerParam()/getIntegerParam() which are appropriate for mbbo/mbbi are not appropriate for enum, and setStringParam()/getStrinParam
are not compatible with mbbo/mbbi type.
Also mbbo/mbbi do not have SVAL field, that sCalcoutRecord has.
|