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: Question about PV value from epics ioc |
From: | Mark Rivers via Tech-talk <tech-talk at aps.anl.gov> |
To: | neu lzf <lzfneu at live.com>, "tech-talk at aps.anl.gov" <Tech-talk at aps.anl.gov> |
Date: | Sun, 28 Apr 2024 23:21:00 +0000 |
One way to do this would be to use a standard drvAsynIPPort rather than ping. If there is a port on another host which is almost always available then you could just periodically open that port and read from it, for example port 80 for
http or port 443 for https. If the asyn connection returns an error then you can assume the network is down. This can all be done with standard EPICS records, with no need to call C code. For example, you can periodically send a GET command to
www.google.com on port 80. If you get timeout or other error you know the network is down. If you are trying to determine if a specific host on your local network is down then that might be different. Mark From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of
neu lzf via Tech-talk Hi, I intend to establish a PV value from epics ioc depending on network connection status judging by the 'ping' command. If the network disconnected, the PV value is 0, otherwise change to 1. I want to consult you how to program the C file to implement this function by using epics, could you please show a demonstration on it. Any help will be appreciated and thanks in advance. |