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

Subject: Re: INFICON Transpector MPH Residual Gas Analyzer (RGA) - http GET requests.
From: Andrew Johnson via Tech-talk <tech-talk at aps.anl.gov>
To: tech-talk at aps.anl.gov
Date: Mon, 9 May 2022 14:09:37 -0700
Note that recent (3.15+) versions of Base have a JSON C stream-parser included in libCom, yajl:

https://epics.anl.gov/base/R7-0/6-docs/doxygen/yajl__parse_8h.html

Wasn't Eric Norum working on one or more http-based device supports? I'm sure they didn't use JSON at the time though.

- Andrew

On 5/9/22 3:01 PM, Mark Rivers via Tech-talk wrote:

Hi Janez,

 

I recently wrote an areaDetector plugin that needs to parse JSON.  It is here:

https://github.com/areaDetector/ADCore/blob/master/ADApp/pluginSrc/NDPluginBadPixel.cpp

 

I used this very nice C++ parser:

https://github.com/nlohmann/json

 

It is just a C++ header file, so no library is needed.

 

I think you could write a simple asynPortDriver that uses drvAsynIPPort for the HTTP gets and the JSON parser to do what you want.

 

Mark

 

 

From: Tech-talk <tech-talk-bounces at aps.anl.gov> On Behalf Of Govednik, Janez via Tech-talk
Sent: Monday, May 9, 2022 2:50 PM
To: tech-talk at aps.anl.gov
Subject: INFICON Transpector MPH Residual Gas Analyzer (RGA) - http GET requests.

 

Hello,

 

We want to develop an EPICS support for Residual Gas Analyzer from Inficon. Unfortunately, RGA is running a web server which is listening for http GET requests on port 80. The response from the web server is in JSON format. My question is if somebody already develop an IOC for this type of device? If not, what would be the best solution? We were thinking that using simple stream device support and .proto file might be too messy in this case. Is there a library for http requests and simple JSON parser if we make our own support?  Do you have an example of http device support or use of JSON parser?

 

Here are two examples of the request and response (what you see in the web browser):

  • /mmsp/scanSetup/channel/1/get
{
    "data": {
        "@id": 1,
        "channelType": "Sweep",
        "startMassRaw": 0,
        "stopMassRaw": 10000,
        "ppamu": 10,
        "dwell": 4.000,
        "emVoltage": null,
        "focusVoltage": null,
        "ionEnergy": null,
        "extra": 0,
        "leadIn": 0,
        "enabled": "True",
        "scaleFactor": 1,
        "relativeRef": 0,
        "reportType": "Absolute",
        "reportUnits": "Current",
        "equivIonFactor": -1,
        "digOutNum": -1,
        "digOutThresUpper": 1,
        "digOutThresLower": -1,
        "startMass": 0.00,
        "stopMass": 100.00,
        "channelMode": "Sweep",
        "rfEquivAMU": 0,
        "dcEquivAMU": 0,
        "rfEquivDAC": 0,
        "dcEquivDAC": 0
    },
    "name": "got",
    "origin": "/mmsp/scanSetup/channel/1"
}

 

·         /mmsp/measurement/scans
·             {
        "name": "got",
        "origin": "/mmsp/measurement/scans",
        "data": [
            {
                "scannum": 31,
                "scansize": 503,
                "values": [
                    538398,
                    4.475908e-10,
                    6.700834e-14,
                    -6.796693e-14,
                    ...
                ]
            },
            {
                "scannum": 32,
                "scansize": 503,
                "values": [
                    556335,
                    1.643438e-09,
                    -1.408637e-13,
                    ...
                ]
            }
        ]
    }
 
Thanks in advance! 
 
Best,
Janez

 


-- 
Complexity comes for free, Simplicity you have to work for.

References:
INFICON Transpector MPH Residual Gas Analyzer (RGA) - http GET requests. Govednik, Janez via Tech-talk
RE: INFICON Transpector MPH Residual Gas Analyzer (RGA) - http GET requests. Mark Rivers via Tech-talk

Navigate by Date:
Prev: RE: INFICON Transpector MPH Residual Gas Analyzer (RGA) - http GET requests. Mark Rivers via Tech-talk
Next: RE: Can't create mutex semaphore: too many Luchini, Kristi L. 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  <20222023  2024 
Navigate by Thread:
Prev: RE: INFICON Transpector MPH Residual Gas Analyzer (RGA) - http GET requests. Mark Rivers via Tech-talk
Next: RE: Can't create mutex semaphore: too many Luchini, Kristi L. 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  <20222023  2024 
ANJ, 14 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·