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: Get the type of a PV in C++ API
From: "Veseli, Sinisa via Tech-talk" <tech-talk at aps.anl.gov>
To: Ralph Lange <ralph.lange at gmx.de>, Eusebio Naif Al-Soliman Fuentes <eunaif at correo.ugr.es>
Cc: Tech Talk <tech-talk at aps.anl.gov>
Date: Fri, 3 Nov 2023 15:50:09 +0000
Hi,

PvaPy C++ code still uses the original APIs, so perhaps this example helps:

https://github.com/epics-base/pvaPy/blob/master/src/pvaccess/PyPvDataUtility.cpp#L410

Sinisa

--
Siniša Veseli
Scientific Software Engineering & Data Management
Advanced Photon Source
Argonne National Laboratory
sveseli at anl.gov
(630)252-9182

From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Eusebio Naif Al-Soliman Fuentes via Tech-talk <tech-talk at aps.anl.gov>
Sent: Friday, November 3, 2023 4:39 AM
To: Ralph Lange <ralph.lange at gmx.de>
Cc: Tech Talk <tech-talk at aps.anl.gov>
Subject: Re: Get the type of a PV in C++ API
 
Hello Ralph.
 
First of all, thanks for your reply. I know the existence of PVXS library and I have already used it succesfully on my project. The problem is that, at the moment, I've noticed that it's slow for our project and I'm looking for a solution with the first-generation API.
 
It could also be an error in my code, what I'm doing at the moment is this:
 
pvxs::Value reply = ctxt.get(var_name_str).exec()->wait();
pvxs::TypeCode type_var = reply["value"].type();
 
Thanks, Eusebio.

---

Saludos/Best regards

University of Granada  

Eusebio Naif Al-Soliman Fuentes
MSc. Data Science and Computer Engineering

eunaif at correo.ugr.es



El 2023-11-02 15:01, Ralph Lange via Tech-talk escribió:
Not an answer to your question, but...

That library you are using is part of the first generation of user-facing
libraries.
Meanwhile, there's a second generation (both for C++ and Java) with more
modern and language-specific API designs. Better usability, easier to work
with, better performance.
These second-generation libraries are stable; they will be replacing the
older generation.
For your use case: The C++ second-generation library is called PVXS -
https://urldefense.com/v3/__https://mdavidsaver.github.io/pvxs/__;!!D9dNQwwGXtA!QvJCJFvFjdyKLmOVaaoqQ-_7p7M-QOxB1j1874UChwdwp4EIbx70WhtalgizLcJWAVZmwNrzC6XHFczTXw-W7sCO$

For any new development - please start there. It will save you from
migrating your application at some point in the near future.

Cheers,
~Ralph


On Thu, 2 Nov 2023 at 12:46, Eusebio Naif Al-Soliman Fuentes via Tech-talk <
tech-talk at aps.anl.gov> wrote:

Hello everybody.

I have a small question. In the pvaClient library for C++ (
https://urldefense.com/v3/__https://docs.epics-controls.org/projects/pvaclient-cpp/en/latest/__;!!D9dNQwwGXtA!QvJCJFvFjdyKLmOVaaoqQ-_7p7M-QOxB1j1874UChwdwp4EIbx70WhtalgizLcJWAVZmwNrzC6XHFczTX6fDGW9p$ ) there
are many examples to get the value and other fields of a PV.

However, in order to get the value as a double, like in this example
https://urldefense.com/v3/__https://github.com/epics-rip/exampleCPP/blob/master/exampleClient/src/examplePvaClientGet.cpp__;!!D9dNQwwGXtA!QvJCJFvFjdyKLmOVaaoqQ-_7p7M-QOxB1j1874UChwdwp4EIbx70WhtalgizLcJWAVZmwNrzC6XHFczTXz1KPekp$ ,
you have to previously know that the PV value is a double. Is there any
method to get the type (int, long, double...) of the value field? Something
like ->getType().

Thanks in advance.
--

Saludos/Best regards

*University of Granada  *

Eusebio Naif Al-Soliman Fuentes
*MSc. Data Science and Computer Engineering*

eunaif at correo.ugr.es

References:
Get the type of a PV in C++ API Eusebio Naif Al-Soliman Fuentes via Tech-talk
Re: Get the type of a PV in C++ API Ralph Lange via Tech-talk
Re: Get the type of a PV in C++ API Eusebio Naif Al-Soliman Fuentes via Tech-talk

Navigate by Date:
Prev: Re: Sequencer interpretation of PV names with {,} characters Kasemir, Kay via Tech-talk
Next: Re: record with constant input link Rolf Keitel 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: Re: Get the type of a PV in C++ API Eusebio Naif Al-Soliman Fuentes via Tech-talk
Next: Re: Get the type of a PV in C++ API Michael Davidsaver 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, 03 Nov 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·