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  <20202021  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  <20202021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: HDF5 client for EPICS 3.15
From: "Jemian, Pete R. via Tech-talk" <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Sun, 9 Aug 2020 23:07:24 +0000
Try Python.  This example needs PyEpics and h5py packages.

Here is an example:

* demo.db  example database
* demo.py  example python program
* demo.h5  example HDF5 output

Run attached demo.db with a softIoc (from EPICS base):

     softIoc -d demo.db

In separate terminal, run the demo program:

     python3 demo.py

See the output in demo.h5.  The content looks like this:

/tmp/demo/demo.h5
   wf10:float64[3] = [2.0, 4.0, 8.0]
   wf5:float64[5] = [1.0, 2.0, 3.0, 4.0, 5.0]

Pete

On 8/8/2020 3:41 PM, Ha, Kiman via Tech-talk wrote:
> Hi All,
> 
> NSLS-II LLRF system has a new circular buffer for the LLRF system 
> oscilloscope function.
> 
> A single waveform size is 1.8 M point and a total of ~40 PVs.
> 
> Does anyone have and any EPICS HDF client program for waveform PVs to 
> HDF5 files?
> 
> Our application is simple steps if the beam dump caused? Read waveforms 
> and write HDF5 files to a specific directory (DD/MM/YYYY).
> 
> 
> Thanks,
> 
> Kiman
> 

-- 
----------------------------------------------------------
Pete R. Jemian, Ph.D.                 <jemian at anl.gov>
Beam line Controls and Data Acquisition (BC, aka BCDA)
Advanced Photon Source,    Argonne National Laboratory
Argonne, IL  60439                    630 - 252 - 3189
-----------------------------------------------------------
       Education is the one thing for which people
          are willing to pay yet not receive.
-----------------------------------------------------------


# demo.db: read waveforms from EPICS and write HDF5 file

# softIoc -d demo.db

record(waveform, "demo:wf10") {
    field(NELM, 10)
    field(FTVL, "DOUBLE")
    field(EGU, "arbitrary")
}

record(waveform, "demo:wf5") {
    field(NELM, 5)
    field(FTVL, "DOUBLE")
    field(EGU, "arbitrary")
}

Attachment: demo.h5
Description: demo.h5

#!/usr/bin/env python

"""demo: read waveforms from EPICS and write HDF5 file"""

import epics
import h5py

wf5 = epics.PV("demo:wf5")
wf10 = epics.PV("demo:wf10")
for obj in (wf5, wf10):
    obj.wait_for_connection()

wf5.put([1,2,3,4,5])
wf10.put([2, 4, 8])

with h5py.File("demo.h5", "w") as fp:
    fp.create_dataset("wf5", data=wf5.value)
    ds = fp.create_dataset("wf10", data=wf10.value)
    ds.attrs["units"] = "arbitrary"

References:
HDF5 client for EPICS 3.15 Ha, Kiman via Tech-talk

Navigate by Date:
Prev: Re: HDF5 client for EPICS 3.15 Mark Rivers via Tech-talk
Next: Re: HDF5 client for EPICS 3.15 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  <20202021  2022  2023  2024 
Navigate by Thread:
Prev: Re: HDF5 client for EPICS 3.15 Mark Rivers via Tech-talk
Next: Re: HDF5 client for EPICS 3.15 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  <20202021  2022  2023  2024 
ANJ, 09 Aug 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·