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  <20152016  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  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: using EPICS code with HTTP port
From: Dirk Zimoch <[email protected]>
To: <[email protected]>
Date: Wed, 11 Feb 2015 14:28:39 +0100
On 09.02.2015 21:58, Kasemir, Kay wrote:
and then you need to be prepared to parse a response that looks like

HTTP/1.1 200 OK
Content-Type: text/html
Server: Whatever
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 97

.. the actual data..

Try regular expressions to fund the actual data in all the http noise. See my example in the StreamDevice documentation:
http://epics.web.psi.ch/software/streamdevice/doc/tipsandtricks.html#web

get_title {
  extrainput = ignore;
  replyTimeout = 1000;
  out "GET http://\$1\n\n";;
  in "%+.1/(?im)<title>(.*)<\/title>/";
}

Here \$1 was the web address (e.g. "10.95.101.75/data" in your case).

out "GET http:..."
This is the short worm of what curl does. (You have sent the string "curl ..." instead of calling curl.)

in "%+.1/(?im)<title>(.*)<\/title>/";
This means: find the tag <title> (ignoring case) and give me the string beween <title> and </title>.

In case you data is not a string but for example a number you want to parse into a ai record, use a regular expressions to find the text right before the data and then parse with %f or another numeric format:

  in "%*/Interesting value:/%f more text";

This first searches for the text "Interesting value:" in the web page and then parses the value with %f. After the value, it expects the string " more text".


Dirk




Replies:
Re: using EPICS code with HTTP port Dirk Zimoch
Re: using EPICS code with HTTP port Bill Lavender
References:
using EPICS code with HTTP port Ana Malagon
RE: using EPICS code with HTTP port Mark Rivers
Re: using EPICS code with HTTP port Kasemir, Kay

Navigate by Date:
Prev: Re: can run multiple IOCs on single host? Dirk Zimoch
Next: Re: using EPICS code with HTTP port Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: using EPICS code with HTTP port Kasemir, Kay
Next: Re: using EPICS code with HTTP port Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·