Hi Jakub,
The easiest way might be monitor the external PV using an ao record, then the same record can write it into the asynPortDriver (using a new float64 parameter reserved for that purpose). Something like:
record(ao, “$(P)$(R)_RemoteMonitor_1”) {
field(OMSL, “closed_loop”)
field(DOL, “$(REMOTE_PV_NAME_1) CP MS”)
field(DTYP, "asynFloat64")
field(OUT, "@asyn($(PORT),$(ADDR))REMOTE_PARAM_1")
}
Where REMOTE_PARAM_1 is the driver name for the new float64 parameter.
Or, the same function could be done using a separate ai (for the monitor) and ao (for the driver write).
Then, in the driver the parameter can be read using the usual getDoubleParam function.
Cheers,
Matt
From: Tech-talk <tech-talk-bounces at aps.anl.gov>
On Behalf Of Wlodek, Jakub via Tech-talk
Sent: Thursday, May 18, 2023 11:10 AM
To: tech-talk at aps.anl.gov
Subject: [EXTERNAL] Optimal way to offer readback of PV from one IOC as a PV within another IOC
Essentially the use case of this is that I have an IOC that aggregates some signals into a custom data structure and transmits the data live over a TCP/IP socket. Most
of the signals are calculated within this IOC itself, but there are two additional ones that I'd like to include that are currently provided by another IOC. For context, the data aggregation IOC is an asynPortDriver, and both signals should be asynFloat64
ao readbacks. What would be the best way to do this? Camonitor/caget events within the readFloat64 method? Or some other solution?