It also looks like Claudio's calc record has INPA and INPB fields that seem to be missing "ca:" prefix.
--
Siniša Veseli
Scientific Software Engineering & Data Management
Advanced Photon Source
Argonne National Laboratory
sveseli at anl.gov
(630)252-9182
From: Johnson, Andrew N. <anj at anl.gov>
Sent: Friday, May 5, 2023 1:46 PM
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
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()'))
string[] choices [Off, On]
long secondsPastEpoch 1683129086
int nanoseconds 834120910
Scientific Software Engineering & Data Management
Argonne National Laboratory
(630)252-9182
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
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
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)'))
string[] choices [Off, On]
long secondsPastEpoch 1683129086
int nanoseconds 834120910
Scientific Software Engineering & Data Management
Argonne National Laboratory
(630)252-9182
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.
|