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: timestampField not retrieved using CA provider for pvac::ClientChannel
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: "Bisegni, Claudio" <bisegni at slac.stanford.edu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>, "Veseli, Sinisa" <sveseli at anl.gov>
Date: Sun, 7 May 2023 22:20:57 -0700
On 5/6/23 11:11, Bisegni, Claudio wrote:
Hi Michael,

Unfortunally my application could talk with PVs that are hosted only on CA protocol. So, I have to manage also this case.

I hope that you can encourage those responsible for these PVs to upgrade at some point soon.


I could execute two monitor on CA PV for listen over two different set of fields and recombine the full structure on client side.

Could be a clean solution?

"Clean" is relative.  The usual way this is handled (assuming a fairly recent epics-base)
is to create two subscriptions.  In the language of libca, one with a DBR_TIME_* type and
event mask DBE_VALUE|DBE_ALARM, and a second with a DBR_CTRL_* type and DBE_PROPERTY.
The dbf_type_to_DBR_*() type promotion macros can help here.

Once both subscriptions have delivered at least the initial update, then you will have a
complete view.  There are some edge cases since these two CA subscriptions may not be as
well synchronized as the one PVA subscription would be.  However, in practice this probably
won't be an issue since DBE_PROPERTY updates are relatively rare.

Of course, if you have an older epics-base where libca doesn't (fully) support DBE_PROPERTY,
the conventional thing to do is to issue a one time GET for DBR_CTRL_* instead of a
second subscription.


Claudio

*From: *Michael Davidsaver <mdavidsaver at gmail.com>
*Date: *Saturday, 6 May 2023 at 08:28
*To: *Bisegni, Claudio <bisegni at slac.stanford.edu>
*Cc: *Andrew Johnson <anj at anl.gov>, Veseli, Sinisa <sveseli at anl.gov>, tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
*Subject: *Re: timestampField not retrieved using CA provider for pvac::ClientChannel

Hello Claudio,

On 5/5/23 12:50, Andrew Johnson via Tech-talk wrote:
The Channel Access network layer can only retrieve specific combinations of metadata corresponding to the DBR types which the native CA code implements, so it's not possible to fetch the timeStamp and alarm data at the same time as other kinds of data such  as the display, control or alarm limits. Unfortunately the CA provider doesn't give any errors if you ask for a combination that it can't provide, it just gives you a subset of the metadata — it might be better if it threw an exception, but it doesn't. I think that fully explains your symptoms.

I think it is worth emphasizing that this CA protocol limitation is _not_ shared by the PVA protocol.
What you tried should work if you were able to use the PVA tools with their native PVA protocol.

Have you tested to see if the PVs you are interested in are also served over PVA?


- Andrew


On 5/5/23 2:44 PM, Bisegni, Claudio wrote:

Should be a my mistake because if I use the pvget with the specific parameter it work:

developer@e058f4bc2090:/workspace$ pvget -p ca -r "field(field,timeStamp,alarm)" ca:variable:a

ca:variable:a structure

    alarm_t alarm

        int severity 0

int status 0

  string message

    time_t timeStamp 2023-05-05 19:22:59.521

        long secondsPastEpoch 1683314579

int nanoseconds 521323913

int userTag 0

I am digging into it.

Anyway, thank you for point me in the right direction

Claudio

*From: *Bisegni, Claudio <bisegni at slac.stanford.edu>
*Date: *Friday, 5 May 2023 at 12:24
*To: *Andrew Johnson <anj at anl.gov>, Veseli, Sinisa <sveseli at anl.gov>, tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
*Subject: *Re: timestampField not retrieved using CA provider for pvac::ClientChannel

I fixed the error reported by Sinisa (the reference to other channel for the sum)

I changed the pv name and not I’m trying to get data from ca:variable:a(below) could be some problem on c++ layer of pvData?

I done:

caput ca:variable:a.PROC 1

caput ca:variable:a.PROC 1

and the I got:

structure

    double value 1

alarm_t alarm

int severity 0

int status 0

string message

    display_t display

double limitLow 0

double limitHigh 0

string description

        string format F6.0

string units

    control_t control

double limitLow 0

double limitHigh 100

double minStep 0

valueAlarm_t valueAlarm

boolean active false

double lowAlarmLimit nan

double lowWarningLimit nan

double highWarningLimit nan

double highAlarmLimit nan

 int lowAlarmSeverity 0

int lowWarningSeverity 0

int highWarningSeverity 0

int highAlarmSeverity 0

byte hysteresis 0

regards

Claudio

*From: *Andrew Johnson <anj at anl.gov>
*Date: *Friday, 5 May 2023 at 11:46
*To: *Bisegni, Claudio <bisegni at slac.stanford.edu>, Veseli, Sinisa <sveseli at anl.gov>, tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
*Subject: *Re: timestampField not retrieved using CA provider for pvac::ClientChannel

Hi Claudio,

Please try running the command

     caput ca:variable:sum.PROC 1

and then run your client again. I suspect that the timestamp of your CALC record is still undefined i.e. 0,0 and that's why it isn't getting displayed.

- Andrew


On 5/5/23 1:23 PM, Bisegni, Claudio via Tech-talk wrote:

     Hi yes sure:

     This is my code:

     auto ca_provider = std::make_unique<pvac::ClientProvider>("ca", epics::pvAccess::ConfigurationBuilder().push_env().build());

     auto channel = std::make_shared<pvac::ClientChannel>(provider.connect(pv_name, opt));

     auto op = channel->get(this, pvd::createRequest("field()"));

     …

     I need to specify that I connect to a IOCs launched with “sofIOC -d xyz.db” this si the content of the DB:

     record(ao, "ca:variable:a")

     {

         field(DRVH, "100")

         field(DOL, "0")

         field(PINI, "YES")

     }

     record(ao, "ca:variable:b")

     {

         field(DRVH, "100")

         field(DOL, "0")

         field(PINI, "YES")

     }

     record(calc, "ca:variable:sum")

     {

         field(SCAN, "1 second")

         field(INPA, "variable:a")

         field(INPB, "variable:b")

         field(CALC, "A+B")

     }

     I got this as answer on get operation:

     structure

         double value 3

         alarm_t alarm

             int severity 0

             int status 0

             string message

         display_t display

             double limitLow 0

             double limitHigh 0

             string description

             string format F6.0

             string units

         control_t control

             double limitLow 0

             double limitHigh 0

             double minStep 0

         valueAlarm_t valueAlarm

             boolean active false

             double lowAlarmLimit nan

             double lowWarningLimit nan

             double highWarningLimit nan

             double highAlarmLimit nan

             int lowAlarmSeverity 0

             int lowWarningSeverity 0

             int highWarningSeverity 0

             int highAlarmSeverity 0

             byte hysteresis 0

     *From: *Veseli, Sinisa <sveseli at anl.gov> <mailto:sveseli at anl.gov <mailto:sveseli at anl.gov>>
     *Date: *Friday, 5 May 2023 at 11:05
     *To: *Bisegni, Claudio <bisegni at slac.stanford.edu> <mailto:bisegni at slac.stanford.edu <mailto:bisegni at slac.stanford.edu>>, tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> <mailto:tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>>
     *Subject: *Re: timestampField not retrieved using CA provider for pvac::ClientChannel

     Hi,

     I am not sure I understand what is going on. Perhaps you could include your code so we can see what exactly you are trying to do?

     Also, if you'd like to get all fields, the string 'field()' or just empty string '' should work:

     >>> print(c.get('field()'))

     epics:nt/NTEnum:1.0

     enum_t value

       int index 0

       string[] choices [Off, On]

     alarm_t alarm

       int severity 0

       int status 0

       string message

     time_t timeStamp

       long secondsPastEpoch 1683129086

       int nanoseconds 834120910

       int userTag 0

     --

     Siniša Veseli

     Scientific Software Engineering & Data Management

     Advanced Photon Source

     Argonne National Laboratory

     sveseli at anl.gov

     (630)252-9182

     ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

     *From:*Bisegni, Claudio <bisegni at slac.stanford.edu> <mailto:bisegni at slac.stanford.edu <mailto:bisegni at slac.stanford.edu>>
     *Sent:* Friday, May 5, 2023 12:56 PM
     *To:* Veseli, Sinisa <sveseli at anl.gov> <mailto:sveseli at anl.gov <mailto:sveseli at anl.gov>>; tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> <mailto:tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>>
     *Subject:* Re: timestampField not retrieved using CA provider for pvac::ClientChannel

     I tried to set request field as:

     pvd::createRequest("field(value, timeStamp, alarm, display, control, valueAlarm)

     but I didn’t get the timeStamp Field in PVStructure. The request field work well for all other (for CA provider) for the PVA provider, instead, I always got every field also if I put only “filed(value)” in the request.

     I’m wrong somenting….

     Claudio

     *From: *Bisegni, Claudio <bisegni at slac.stanford.edu> <mailto:bisegni at slac.stanford.edu <mailto:bisegni at slac.stanford.edu>>
     *Date: *Friday, 5 May 2023 at 10:44
     *To: *Veseli, Sinisa <sveseli at anl.gov> <mailto:sveseli at anl.gov <mailto:sveseli at anl.gov>>, tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> <mailto:tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>>
     *Subject: *Re: timestampField not retrieved using CA provider for pvac::ClientChannel

     Hi,

     Thank you for yor help, is effect on get operation I use the default request, so Iat this point I need to use pvd::createRequest("field(value, timeStamp, alarm, display, control, valueAlarm)"));to retrieve all field

     I’ll give a try!

     Thank you very much.

     Claudio

     *From: *Veseli, Sinisa <sveseli at anl.gov> <mailto:sveseli at anl.gov <mailto:sveseli at anl.gov>>
     *Date: *Friday, 5 May 2023 at 09:55
     *To: *tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> <mailto:tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>>, Bisegni, Claudio <bisegni at slac.stanford.edu> <mailto:bisegni at slac.stanford.edu <mailto:bisegni at slac.stanford.edu>>
     *Subject: *Re: timestampField not retrieved using CA provider for pvac::ClientChannel

     Hi,

     I am not sure exactly why is there a difference in behavior between caget and pvget, but you should be able to get timestamps if you request them explicitly:

     $ caget -a S01-DAQTBT:Strm:DataCaptureC

     S01-DAQTBT:Strm:DataCaptureC   2023-05-03 10:51:26.834121 Off

     PV request string like field(value,timeStamp) should work from C++:

     >>> from pvapy import *

     >>> c = Channel('S01-DAQTBT:Strm:DataCaptureC', CA)

     >>> print(c.get('field(value,timeStamp)'))

     epics:nt/NTEnum:1.0

       enum_t value

           int index 0

           string[] choices [Off, On]

       time_t timeStamp

           long secondsPastEpoch 1683129086

           int nanoseconds 834120910

           int userTag 0

     Hope this helps,

     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> <mailto:tech-talk-bounces at aps.anl.gov <mailto:tech-talk-bounces at aps.anl.gov>> on behalf of Bisegni, Claudio via Tech-talk <tech-talk at aps.anl.gov> <mailto:tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>>
     *Sent:* Friday, May 5, 2023 11:39 AM
     *To:* tech-talk at aps.anl.gov <tech-talk at aps.anl.gov> <mailto:tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>>
     *Subject:* timestampField not retrieved using CA provider for pvac::ClientChannel

     Hello EPICS tech,

     I'm working with last epics release and I have notice that making a get operation for an IOC using a CA provider for crete a pvac::ClientChannel I don't receive the timestamp field:

     I noticed that also the official caget has the problem:

     developer@e058f4bc2090:/workspace$ pvget variable:sum

     variable:sum 2023-05-05 16:34:54.607 3

     developer@e058f4bc2090:/workspace$ caget variable:sum

     variable:sum 3

     so is a client library problem or a server or something else?

     Thank

     you in advance.

     Claudio




--
Complexity is free, it's Simplicity that takes work.

--
Complexity is free, it's Simplicity that takes work.




Replies:
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio via Tech-talk
References:
timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Veseli, Sinisa via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Veseli, Sinisa via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Andrew Johnson via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Andrew Johnson via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Michael Davidsaver via Tech-talk
Re: timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio via Tech-talk

Navigate by Date:
Prev: Job Opportunity at the Canadian Light Source Gillian Black via Tech-talk
Next: Re: Why does libca.so depend on libreadline.so? 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 
Navigate by Thread:
Prev: Re: timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio via Tech-talk
Next: Re: timestampField not retrieved using CA provider for pvac::ClientChannel Bisegni, Claudio 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, 11 May 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·