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: StreamDevice Raw converter
From: Henrique Silva via Tech-talk <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 11 Feb 2020 15:11:55 +0000

Hi,


I'm trying to retrieve a waveform from an oscilloscope using StreamDevice, but I'm having some problems converting the binary data.


The scope sends the waveform raw data using the IEEE 488.2 definite length block format (a small ASCII header indicating how many bytes will be sent and right after that the binary data). For example, when it sends 3 16-bit points, the received message is:

C1:WF DAT1,#9000000006<BIN1><BIN1><BIN2><BIN2><BIN3><BIN3>


I have the following records:


record(waveform, "$(P)$(R)Wfm1")
{
    field(SCAN, "Passive")
    field(DTYP, "stream")
    field(FTVL, "SHORT")
    field(INP,  "@scope.proto read_wave_bin(C1, $(P)$(R)Wfm1ByteCount) $(PORT)")
    field(NELM, "50")
}

record(ai, "$(P)$(R)Wfm1ByteCount")
{
    field(DESC, "Waveform byte count channel 1")
}

And the following protocol function:

read_wave_bin {
    separator="";
    out "\$1:WF? DAT1";
    in "\$1:WF DAT1,#9%(\$2)9d%02r";
}

But when I process this waveform record, I get the following error:

sevr=major readData LAB:SCP-02:Wfm1: can't convert from DBF_INT64 to DBF_SHORT
2020/02/04 17:25:01.657852 WAVEPRO LAB:SCP-02:Wfm1: Input "%<b8>/<b8>4<b8>" does not match format "%02r"

I can see that the "Wfm1ByteCount" record is being set correctly, matching the "#9000000006" string, so the problem is only on the binary matching/conversion.
I've tried changing the waveform FTVL type to INT64, but it still complains about the type conversion ("can't convert from DBF_INT64 to DBF_INT64").


Does anyone know how to fix this problem?


Thanks in advance,


Henrique Silva


Replies:
Re: StreamDevice Raw converter Henrique Silva via Tech-talk

Navigate by Date:
Prev: RE: SNCSEQ Error Windows Hetz, Benjamin via Tech-talk
Next: Re: SNCSEQ Error Windows Benjamin Franksen 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: Building EPICS base/IOC only for cross target Johnson, Andrew N. via Tech-talk
Next: Re: StreamDevice Raw converter Henrique Silva 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, 11 Mar 2020 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·