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: StreamDevice reading waveforms
From: Anthony Pietryla <[email protected]>
To: Davide Marcato <[email protected]>
Cc: [email protected]
Date: Mon, 13 Apr 2015 07:46:19 -0500
Thank you Davide.

Tony

On Apr 10, 2015, at 2:34 AM, Davide Marcato <[email protected]> wrote:

I had a similar problem, I think that you can't parse two integers on the same line (the 'in' field of the protocol file), but I'm not sure, maybe someone more expert can explain.. 
I solved parsing the whole line as a string and then I converted it into two integers. Maybe you already know, but pay attention not to parse the separator "\n" as part of that string because because otherwise the waveform is not able to recognize it as the separator.

Davide


On 09/04/2015 23:01, Anthony Pietryla wrote:
I have a device which uses SCPI protocol and returns sets of waveforms in columns where I can request how many rows to return. For instance I can query the device for 3 values of position data and it will return 2 columns (X & Y) and 3 rows. I want to read the columns into separate waveform records. I am having problems with the protocol file for which I need help.

The database records and the protocol file are listed below. When I process the record only the first values (first row of data) are written to each record. With asyn debugging turned on the console shows all three sets of data:

epics> 2015/04/09 13:52:36.877 L0 wrote
TBT_XY 3

2015/04/09 13:52:36.878 L0 read
  2000   6000
  7143   4286
  4286   1429

caget shows only the first value stored:

caget -# 5 B:Spark:TBT_Horizontal
B:Spark:TBT_Horizontal 5 3333 0 0 0 0

caget -# 5 B:Spark:TBT_Vertical
B:Spark:TBT_Vertical 5 -1111 -3333 0 0 0

*******************
The protocol file has:

getTBT_XY {
   Separator = "\n";
   out "TBT_XY 3";
   in   " %(\$1TBT_Horizontal)d %(\$1TBT_Vertical)d";
   ExtraInput = Ignore;
}

**************
The database records are:

record(waveform, "$(P)$(R)TBT_Horizontal")
{
   field(DESC, "TBT Horizontal")
   field(DTYP, "stream")
   field(INP,  "@spark.proto getTBT_XY($(P)$(R)) $(PORT)")
   field(NELM, "262144")
   field(EGU,  "um")
   field(FTVL, "LONG")
}

record(waveform, "$(P)$(R)TBT_Vertical")
{
   field(DESC, "TBT Vertical")
   field(DTYP, "Soft Channel")
   field(NELM, "262144")
   field(EGU,  "um")
   field(FTVL, "LONG")
}

********************
When I comment out the “ExtraInput = Ignore;” line in the protocol file I get error messages:

2015/04/09 15:53:58.170 L0 wrote
TBT_XY 3

2015/04/09 15:53:58.170 L0 asynOctetBase interrupt
2015/04/09 15:53:58.171 L0 read
  3333  -1111
 -3333  -5556
 -2000      0

2015/04/09 15:53:58.271 L0 B:Spark:TBT_Horizontal: 29 bytes surplus input "<0a> -3333  -5556<0a> -200..."
2015/04/09 15:53:58.271 L0 B:Spark:TBT_Horizontal: after 13 bytes: "  3333  -1111"

caget -# 5 B:Spark:TBT_Horizontal
B:Spark:TBT_Horizontal 5 3333 0 0 0 0

caget -# 5 B:Spark:TBT_Vertical
B:Spark:TBT_Vertical 5 -1111 -3333 0 0 0



-- 
Davide Marcato
INFN - Laboratori Nazionali di Legnaro
Viale dell'Universita', 2
35020 LEGNARO (PD) - ITALY
Phone: +39 0498068454	

--
Anthony Pietryla
Principal Controls Engineer
Advanced Photon Source
Argonne National Laboratory

Phone: 630-252-7430
Fax: 630-252-6123


References:
StreamDevice reading waveforms Anthony Pietryla
Re: StreamDevice reading waveforms Davide Marcato

Navigate by Date:
Prev: Re: StreamDevice reading waveforms Dirk Zimoch
Next: Re: StreamDevice reading waveforms Anthony Pietryla
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: StreamDevice reading waveforms Davide Marcato
Next: Re: StreamDevice reading waveforms 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 ·