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: DBRecord <-> PVRecord data exchange |
From: | Ignacio Arriagada via Tech-talk <tech-talk at aps.anl.gov> |
To: | "Veseli, Sinisa" <sveseli at anl.gov> |
Cc: | "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Mon, 16 Oct 2023 10:54:05 -0700 |
Hi,
pvaClient is just a client library for interacting with PVA server over pvaccess.
As far as I know, from your C++ code on the PVA server side, you interact with PVRecord using pvDatabase APIs (e.g., PVRecord class has process() interface; see, for example, how callbacks can be triggered: https://github.com/epics-base/pvaPy/blob/e1e3965574dbcc36e015bc36231f322491dfbe39/src/pvaccess/PyPvRecord.cpp#L91).
If it helps, here is also an example of how record updates are done in pvapy: https://github.com/epics-base/pvaPy/blob/e1e3965574dbcc36e015bc36231f322491dfbe39/src/pvaccess/PyPvRecord.cpp#L134
I think something similar is done for record updates in the area detector pva server plugin: https://github.com/areaDetector/ADCore/blob/master/ADApp/pluginSrc/NDPluginPva.cpp
I hope this helps,
Sinisa
--
Siniša Veseli
Scientific Software Engineering & Data Management
Advanced Photon Source
Argonne National Laboratory(630)252-9182
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Ignacio Arriagada via Tech-talk <tech-talk at aps.anl.gov>
Sent: Wednesday, October 11, 2023 10:46 AM
To: Joao Paulo Martins <JoaoPaulo.Martins at ess.eu>
Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: Re: DBRecord <-> PVRecord data exchangeHello Joao,Thank you so much for your reply!I think I understand. What I need is closer to [4], but this leads me to the following questions.
- Is using the pvaClient lib the only way to interact with a PVRecord? If I want to trigger processing on a PVRecord from a thread running on my IOC, would something like a putGet() on the PVStructure of said record be THE way to trigger it?
- For PVRecords, is there something like SCAN=EVENT? For DBRecords, I would call postEvent(eventNameToHandle("rec_trgr")) to process a particular record or set of records from within a thread or a callback. Is there something like it for PVRecords?
Thanks again for your help and patience.Best regards,Ignacio
On Thu, Oct 5, 2023 at 11:45 AM Joao Paulo Martins via Tech-talk <tech-talk at aps.anl.gov> wrote:
Hello Ignacio,
It depends on exactly what you want to achieve. If you want to create a Normative Types PV from your regular EPICS database, you might want to use the PV groups [1].
You also can do a lot by using PVA links [2] in your database records.
In the example below you would read from PVA to a longin record:
record(longin, "$(P)$(R)DBRInput") {
field(DESC, "Copy of PVAInput")
field(INP, {pva:{pv:"$(P)$(R)PVAInput",proc:true}})
}
You can also do the other way around and write to a Normative Types PV:
record(longout, "$(P)$(R)DBROut") {
field(DESC, "write using PVA")
field(OUT, {pva:{pv:"$(P)$(R)PVAOut"}})
}
PVA links are available in the pva2pva library that is part of EPICS Base already, and soon will be also in PVXS (QSRV2).
But if you need at a more "complex" integration, I would definitively go for PVXS inside you IOC [3]. You can use the aSub record to read from your regular DBR PVs (records) and from there you can use the SharedPV class from PVXS to do whatever you want. Bruno Martins has a very nice example [4]. If your "old" IOC runs EPICS Base 7+ and QSRV is enabled, it is already producing Normative Types PVs that could be accessed by a PVXS client context via read (get) and subscription (monitor) operations inside the same IOC.
[1] - https://epics-base.github.io/pva2pva/qsrv_page.html#qsrv_group_def
[2] - https://epics-base.github.io/pva2pva/qsrv_page.html#qsrv_link
[3] - https://indico.fnal.gov/event/58280/contributions/264559/
[4] - https://github.com/brunoseivam/tabulator/blob/main/stackerApp/src/stackerSup.cpp
Kind regards,
João Paulo Martins
European Spallation Source ERIC
From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Ignacio Arriagada via Tech-talk <tech-talk at aps.anl.gov>
Sent: Wednesday, October 4, 2023 5:38:50 PM
To: tech-talk at aps.anl.gov
Subject: DBRecord <-> PVRecord data exchangeHello Tech-Talk!I'm trying to integrate PVAccess (or PVXS) capabilities into an old IOC.
- What would be the best way to exchange data between the old DBRecords and the new PVRecords with custom data structures, within the same IOC?
- Do I need to set up a pvClient within the same ioc?
- Does the exchange need to be done via PVAccess connections or is there an internal way of doing it?
I've been reading Marty Kraimer EPICSV4 developers guide and associated git examples. I'm also consulting Michael Davidsaver's PVXS documentation but it is not clear to me yet how to accomplish this. Are there other resources or examples that I could access regarding this topic?Thank you all in advance,Regards,Ignacio