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

Subject: Re: StreamDevice: variable number of lines
From: Zimoch Dirk via Tech-talk <tech-talk at aps.anl.gov>
To: "Daykin, Evan" <daykin at frib.msu.edu>
Cc: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 31 Jan 2024 20:49:11 +0000
I just see you need to strip off either the hex or the dec value as well or you will get 4 values in your example reading the dec value as hex too. Makes the regex a bit more complicated…

Dirk

Am 31.01.2024 um 21:46 schrieb Zimoch Dirk <dirk.zimoch at psi.ch>:

 Hi Evan,

Probably. It may be expensive in terms of execution time though. And it is limited to the size of your waveform record of course.
My idea is to strip off the addresses first with a regsub and then read the words. You cannot use InTerminator because we need the whole command output in our input „line“. Thus you need to use ReadTimout with the latency penalty involved. (If you have no other channel to signal „finished“ like for example GPIB has with its EOI line.)

Something like this (totally untested):
ReadMem {
    InTerminator=;
    ReadTimeout=100; # whatever works
    out “r %(\$1:start)x 2“; # start taken fron another record, not sure what the 2 is, lines?
    in “%#/\n[0–9A-Fx]+://“  # remove newline and addresses
        “%x“;
)
Use with a waveform or aai with FTVL=LONG and NELM big enough.
Using LONG gives you signed values but avoids conversion to double in CA. NELM limits the number of words you can read. The actual number of words read will be in NORD.

The alternative would be to preprocess input with an asynInterpose layer you would have to write.

Dirk

Am 31.01.2024 um 20:44 schrieb Daykin, Evan via Tech-talk <tech-talk at aps.anl.gov>:



Hi Tech-Talk,

 

I would like to read out the contents of the device memory in a waveform. For example, reading two words from memory, starting at address 0x0:

 

>r 0x0 2

 

0x00000000: 0xEA000049 3925868617

0x00000004: 0xEA000025 3925868581

 

So, the response has one new line, and then any number of “<address>: <value in hex> <value in dec>”. Does StreamDevice support mapping a variable number of lines to a waveform/aai record?

 

Thanks,
Evan

 

 


References:
StreamDevice: variable number of lines Daykin, Evan via Tech-talk
Re: StreamDevice: variable number of lines Zimoch Dirk via Tech-talk

Navigate by Date:
Prev: Re: StreamDevice: variable number of lines Zimoch Dirk via Tech-talk
Next: RMP, REP garbage value whitetiger1123 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  2023  <2024
Navigate by Thread:
Prev: Re: StreamDevice: variable number of lines Zimoch Dirk via Tech-talk
Next: RMP, REP garbage value whitetiger1123 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  2023  <2024
ANJ, 01 Feb 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·