Experimental Physics and
| |||||||||||||||
|
Dear all, When monitoring a PV using the following Java code snippet, if the status of the PV changes from connected to disconnected, valueChanged() will be invoked and the disconnected status can be checked. However, if the initial status of the PV is already disconnected, then valueChanged() will not be invoked, thus I do not know if the PV is disconnected or "connected but has no new value". import org.epics.vtype.VType; import org.phoebus.pv.PV; import org.phoebus.pv.PVPool; import io.reactivex.rxjava3.disposables.Disposable; public class Test { public void start() throws Exception { PV pv = PVPool.getPV("test:123"); Disposable pv_flow = pv.onValueEvent().subscribe(this::valueChanged); } private void valueChanged(final VType value) { if (PV.isDisconnected(value)) { System.out.println("PV is disconnected"); } } } How can I check if the PV is initially disconnected or is not available at all using this monitoring approach? Thanks, Lin
| ||||||||||||||
ANJ, 19 May 2024 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |