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

Subject: Re: Using waveform to read array in StreamDevice
From: Maren Purves via Tech-talk <tech-talk at aps.anl.gov>
To: Zimoch Dirk <dirk.zimoch at psi.ch>
Cc: "279762081 at qq.com" <279762081 at qq.com>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Thu, 20 Apr 2023 01:05:07 -1000
Thanks Dirk,
the device broke years ago, so this really isn't an issue anymore, but it worked the way I did it.

Maren

On Thu, Apr 20, 2023 at 12:29 AM Zimoch Dirk <dirk.zimoch at psi.ch> wrote:
On Wed, 2023-04-19 at 11:00 -1000, Maren Purves wrote:
> If you're writing code anyway (like for an asub record) you can strip those characters out just like any other - I once had to deal with a device that sent 3 lines of output that I wanted to fit into a (3.13, probably .5 or .8) stringin.
>

Aloha Maren,

No, I did not write code to solve that problem.

With only 3 lines, you may try to write 3 'in' commands in one protocol (and use
redirection).

More details about your 3 lines?

Dirk



> Aloha,
>
> Maren Purves
> East Asian Observatory / JCMT
>
> On Wed, Apr 19, 2023 at 5:56 AM Zimoch Dirk via Tech-talk <tech-talk at aps.anl.gov> wrote:
> > Hello Kevin,
> >
> > Unfortunately, StreamDevice does not yet support columns (or tables).
> > You may be able to read the whole array into a waveform then use a aSub Record
> > to filter out the columns, but that s a bit tricky because of , and CR LF.
> >
> > Maybe I can say more tomorrow...
> >
> > Dirk
> >
> >
> > On Wed, 2023-04-19 at 19:53 +0800, 若兰 via Tech-talk wrote:
> > > Hello everyone,
> > >     I have a Counter which can store data  to a buffer.
> > >     (1)  With command "GSDAL?", an array can be read out from the buffer, which looks like this:
> > >       
> > >        fig.1
> > >     
> > >               
> > >     The first 8 colums are Counter data and the last coloum is Timer data.  Every line end with CR+RF.
> > >     (2) With another command “GSCRD?00000000100”, the buffer can get the following array. Every line end with CR+RF.
> > >       
> > >     fig.2
> > >     
> > >
> > > Question 1. How to read the  2-d array (fig 1) into EPICS? Can I use a waveform to do it? Does anybody has an example for it?
> > >   
> > > Question2. I used a waveform to read the second array (in fig.2).
> > >     record(waveform, "$(D):Array0")
> > >    {
> > >       field(DTYP, "stream")
> > >       field(INP, "@xxx.proto  array_in  $(PORT)")
> > >       field(NELM, "100")
> > >       field(FTVL, "SHORT")
> > >       field(SCAN, "5 second")
> > >    }
> > >
> > > in the xxx.proto:
> > >   array_in {
> > >   seperator=CR;  #or CR LF,  no different result
> > >   out  "GSCRD?00000000100";
> > >   in "%5d";
> > > }
> > >     
> > > and the result shows:
> > >  xxx:Array0 200  0  0  0   0  0  ....   0
> > > Surely the data is not read correctly.
> > >
> > > I wonder what the problem is. 
> > > Can I use waveform to read it?
> > > Is there any problem with waveform? For example, the seperator?
> > > If not use waveform, how can I read the array out from device buffer?
> > >
> > > Thanks very much for any advice.
> > >
> > > Best reguards
> > >
> > > Kevin
> > > 279762081 at qq.com
> > >
> > >
> > >

References:
Using waveform to read array in StreamDevice =?gb18030?b?yPTAvA==?= via Tech-talk
Re: Using waveform to read array in StreamDevice Zimoch Dirk via Tech-talk
Re: Using waveform to read array in StreamDevice Maren Purves via Tech-talk
Re: Using waveform to read array in StreamDevice Zimoch Dirk via Tech-talk

Navigate by Date:
Prev: Re: Using waveform to read array in StreamDevice Zimoch Dirk via Tech-talk
Next: Search all PV available CAOUEN Loic 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  <20232024 
Navigate by Thread:
Prev: Re: Using waveform to read array in StreamDevice Zimoch Dirk via Tech-talk
Next: Re: Using waveform to read array in StreamDevice Zimoch Dirk 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  <20232024 
ANJ, 20 Apr 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·