EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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 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
<== Date ==> <== Thread ==>

Subject: Re: RE: Question about PV value from epics ioc
From: Mark Rivers via Tech-talk <tech-talk at aps.anl.gov>
To: "lzfneu at live.com" <lzfneu at live.com>, "tech-talk at aps.anl.gov" <Tech-talk at aps.anl.gov>
Date: Tue, 30 Apr 2024 13:42:23 +0000
  • ... device is TCP socket connection on local network that call C code to get live data by using epics. 
  • I intend to add a piece of C code to determine if the network connection of the device is down and then set the PV value to zero rather than always display the last data before its down when camonitor the PV. 

I want to make sure I understand what you are saying.  Do you mean you have an EPICS driver that talks to the device with TCP to get data?  Does EPICS send a query and then read the response?  If so, then you should be able to tell if the device is down by just seeing if the query timed out.

You should consider seeing the alarm status and severity of the records for the device if it is not available.  Then the OPI displays can indicate the alarm status, and not just a value of 0.

Mark


From: lzfneu at live.com <lzfneu at live.com>
Sent: Monday, April 29, 2024 12:51 AM
To: Mark Rivers <rivers at cars.uchicago.edu>; tech-talk at aps.anl.gov <Tech-talk at aps.anl.gov>
Cc: lzfneu <lzfneu at live.com>
Subject: Re: RE: Question about PV value from epics ioc
 
Thanks for your reply. Actually I intend to determine if the device on local network (ip:192.168.1.100) connection is down and the device is TCP socket connection on local network that call C code to get live data by using epics. I intend to add a piece of C code to determine if the network connection of the device is down and then set the PV value to zero rather than always display the last data before its down when camonitor the PV. I want to consult you if I need to call C code, and if so, could you please show a demo on it. Thanks again.
 
From: Mark Rivers
Date: 2024-04-29 07:21
Subject: RE: Question about PV value from epics ioc

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
Sent: Saturday, April 27, 2024 8:16 PM
To: tech-talk at aps.anl.gov
Subject: Question about PV value from epics ioc

 

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.


References:
Question about PV value from epics ioc neu lzf via Tech-talk
RE: Question about PV value from epics ioc Mark Rivers via Tech-talk
Re: RE: Question about PV value from epics ioc lzfneu--- via Tech-talk

Navigate by Date:
Prev: Re: AreaDetectors - ADPylon Donny Domagoj Cosic via Tech-talk
Next: Re: AreaDetectors - ADPylon Mark Rivers 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: Re: RE: Question about PV value from epics ioc lzfneu--- via Tech-talk
Next: epics servo motor control 백호령 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, 30 Apr 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·