Experimental Physics and Industrial Control System
|
> if the initial status of the PV is already disconnected
Each PV starts out in the disconnected state.
Ideally, it will then connect “real soon” and you get the first value update, but if you never hear anything, that means it was and remains disconnected.
-Kay
From:
Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Wang, Lin via Tech-talk <tech-talk at aps.anl.gov>
Date: Thursday, May 16, 2024 at 11:29 AM
To: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>
Subject: [EXTERNAL] How to check if a PV is initially disconnected using org.phoebus.pv.PV.onValueEvent().subscribe()
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
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
|
- References:
- How to check if a PV is initially disconnected using org.phoebus.pv.PV.onValueEvent().subscribe() Wang, Lin via Tech-talk
- Navigate by Date:
- Prev:
XSPRESS3 error messages John Dobbins via Tech-talk
- Next:
Re: XSPRESS3 error messages Matthew Newville 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>
- Navigate by Thread:
- Prev:
How to check if a PV is initially disconnected using org.phoebus.pv.PV.onValueEvent().subscribe() Wang, Lin via Tech-talk
- Next:
XSPRESS3 error messages John Dobbins 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>
|
ANJ, 11 Sep 2024 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
·
Search
·
EPICS V4
·
IRMIS
·
Talk
·
Bugs
·
Documents
·
Links
·
Licensing
·
|