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  2023  2024  <2025 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  2023  2024  <2025
<== Date ==> <== Thread ==>

Subject: Re: Understand pvget and pvxget
From: Michael Davidsaver via Tech-talk <tech-talk at aps.anl.gov>
To: "Zhang, Tong" <ZhangT at frib.msu.edu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 7 Jan 2025 12:17:50 -0800
Hi Tong,

Firstly, the pvx* CLI tools from PVXS are so far not recommended
for end users since they are not as "friendly" as would be expected.
There is a moderately sized TODO project here.

https://urldefense.us/v3/__https://github.com/epics-base/pvxs/issues/66__;!!G_uCfscf7eWS!eOwRR_1vh8ILXAdmGDb9OP4pToo7RjtWPg2f4cMmaVYpAQ2kCJ9GzsCvmxxP0cIrMWUDJjZLkyf2-d1MUEy4Y-RV0Q$
Where I tried applying `-r value` option to the latter, and hoping it
would print only the value field ...

The handling of pvRequest does not in fact work like dereference as
you (and most users) first expect.  Rather, pvRequest acts as a bit
mask to select a set of field names.

So "-r value" or "-r value,alarm" are equally valid.  In either case
the network operation will yield a top level PVA Structure containing
a member field 'value' which is marked as "changed".

Another way of phrasing this.  The pvRequest bit mask is applied
to all PVA delta values.  So unselected fields values will never
be sent, and will never appear as "changed" to the client.

... some issues are with the tools.

Yes!

The pvtools from pvAccessCPP are not consistent about rendering
partial Structures in "nt" format.  In part this is a difficult
problem since PVA is so flexible.  There are a very large number of
possible permutations for even the "simple" NTScalar schema, and it
would be difficult to define how each should be rendered.


On 1/7/25 11:54, Zhang, Tong via Tech-talk wrote:
Happy new year, community!

Probably a dummy question here: how to correctly use the "-r <pv
request>" option of `pvxget` or `pvget`?

First of all, the tool versions I'm tested:
$ pvxget -V:
PVXS 1.3.2 (1.3.1-41-g87abad5387c22045cb5e-dirty)
EPICS 7.0.8.1
libevent 2.2.1-alpha-dev

$ pvget -V:
pvAccess 7.1.7
pvData 8.0.6
Base 7.0.8.1

And the record testing against:
record(calc, "pva:test:counter") {
     field(INPA, "pva:test:counter")
     field(CALC, "A+1")
     field(SCAN, "1 second")
}

The default behavior of the two commands are slightly different:
$ pvget pva:test:counter  # just outputs the value, which is I expected
pva:test:counter 2025-01-07 14:39:44.950  2663
$ pvxget pva:test:counter  # outputs the full string, is not I
expected, but    some options may help
pva:test:counter
     struct "epics:nt/NTScalar:1.0"
     value double = 2708
     alarm.severity int32_t = 0
     alarm.status int32_t = 0
     alarm.message string = "NO_ALARM"
     timeStamp.secondsPastEpoch int64_t = 1736278829
     timeStamp.nanoseconds int32_t = 950403289
     timeStamp.userTag int32_t = 0
     display.limitLow double = 0
     display.limitHigh double = 0
     display.description string = ""
     display.units string = ""
     display.precision int32_t = 0
     display.form.index int32_t = 0
     display.form.choices string[] = {7}["Default", "String", "Binary",
"Decimal", "Hex", "Exponential", "Engineering"]
     control.limitLow double = 0
     control.limitHigh double = 0
     control.minStep double = 0
     valueAlarm.active bool = false
     valueAlarm.lowAlarmLimit double = nan
     valueAlarm.lowWarningLimit double = nan
     valueAlarm.highWarningLimit double = nan
     valueAlarm.highAlarmLimit double = nan
     valueAlarm.lowAlarmSeverity int32_t = 0
     valueAlarm.lowWarningSeverity int32_t = 0
     valueAlarm.highWarningSeverity int32_t = 0
     valueAlarm.highAlarmSeverity int32_t = 0
     valueAlarm.hysteresis int8_t = 0

Where I tried applying `-r value` option to the latter, and hoping it
would print only the value field, but it still acts the same. So that
brought up the question at the very beginning.

As per the documentation at
https://urldefense.us/v3/__https://epics-base.github.io/pvxs/overview.html*sub-field-lookup__;Iw!!G_uCfscf7eWS!ZTNZy0ZfewN7Pbf068ihPM9Im5m94ieAKdmc_jbwxEAIt7IA2x4hfw5YGU5OrolGrnUIMQTseB29vj8Q0W6-yqti$ , I
assume the "value" is the one of the *fields* that should be defined in
`-r` option, but I cannot find the precision definition.

Intuitively, I tried `pvget -r "timeStamp" pva:test:counter` hoping to
get only the timestamp info, but it outputs the same as without the `-
r` option.

So either is my understanding to this *-r option* is wrong, or I passed
the wrong field, that is my understanding to *field* is wrong, or some
issues are with the tools.

Very much appreciate to any hints.

Cheers,
Tong



References:
Understand pvget and pvxget Zhang, Tong via Tech-talk

Navigate by Date:
Prev: Understand pvget and pvxget Zhang, Tong via Tech-talk
Next: Re: Resetting a compress record to empty it Érico Nogueira Rolim 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  2023  2024  <2025
Navigate by Thread:
Prev: Understand pvget and pvxget Zhang, Tong via Tech-talk
Next: Re: Resetting a compress record to empty it Érico Nogueira Rolim 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  2023  2024  <2025
ANJ, 07 Jan 2025 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·