EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: NTEnum
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: Gabriel Fedel <gabriel.fedel at ess.eu>
Cc: tech-talk at aps.anl.gov
Date: Sat, 22 Jul 2023 09:13:23 -0700
On 7/21/23 00:42, Gabriel Fedel via Tech-talk wrote:
Hi Tech-Talk,

I'm playing a bit with the NTEnum (https://docs.epics-controls.org/en/latest/specs/Normative-Types-Specification.html#ntenum), and I'm wondering if would be possible to use a string as the input so I would get its index.

Something like:

pvput PVEnum "ABC"

This is what should happen now.

NTEnum is a bit awkward as it requires that clients be aware of
value.index and value.choices.  In the specific case of pvput
the code involved is here.

https://github.com/epics-base/pvAccessCPP/blob/581d100a029e6f68f3c1830b90509b3ee5ebd7a0/pvtoolsSrc/pvput.cpp#L180-L202

Note that this code is triggered when field being written is a
sub-structure with ID "enum_t".  So it isn't limited to NTEnum.


pvget PVEnum
return : 5

"pvget PVEnum value.index" would print the numeric index.


I'm using this db as a start point: https://github.com/epics-base/pva2pva/blob/master/iocBoot/iocimagedemo/ntenum.db

Thanks in advance
Cheers



Replies:
Re: NTEnum Gabriel Fedel via Tech-talk
References:
NTEnum Gabriel Fedel via Tech-talk

Navigate by Date:
Prev: Re: [EXTERNAL] Need help with Phoebus Alarm E-logger and Interface to the E-mail Kasemir, Kay via Tech-talk
Next: SNCSEQ Downloading Владимир Сергейчик via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
Navigate by Thread:
Prev: NTEnum Gabriel Fedel via Tech-talk
Next: Re: NTEnum Gabriel Fedel via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  <20232024 
ANJ, 24 Jul 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·