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  <20122013  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  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Reading scope waveforms with StreamDevice + asyn
From: Mark Rivers <[email protected]>
To: "'Rod Nussbaumer'" <[email protected]>, epics Techtalk <[email protected]>
Date: Thu, 12 Jan 2012 22:55:13 +0000
Hi Rod,

> I seem to be stuck between a rock and a hard place: either I use an 
> end-of-line terminator, which will eventually show up in the binary data 
> and prematurely terminate the read, or if I try to use the option to not 
> use end-of-message characters, it will wait until the read times out, 
> which seems to have the effect of invalidating the record, and slowing 
> things down a lot., 

I am not familiar with this exact setup, but asyn in general has another option on when to terminate a read: when the desired number of bytes have been received.  Since you have binary data you know that number.  I am not sure where you specify that in your setup, but I suspect it is possible.

You could test with an asyn record.  TMOD=Write/Read, OFMT=ASCII, IFMT=Binary, NRRD=2000 (500 points times 4 bytes/point).  The BINP field will contain the binary data when the read completes.

Mark


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Rod Nussbaumer
Sent: Thursday, January 12, 2012 4:10 PM
To: epics Techtalk
Subject: Reading scope waveforms with StreamDevice + asyn

Hi all.

I've been trying to read waveforms from a Tektronix TDS8000 scope using 
R3.14.11 + StreamDevice (2.4) + asyn (4.13) + linux-gpib using a NI PCI 
GPIB interface on an x86 PC platform. I cannot seem to find the right 
message termination to satisfy all of the various components.

The scope documentation says it does not use end-of-line terminator 
characters, but rather sets EOI on the GPIB to signal end of messages. 
Nevertheless, there are LF characters appended to each message, even 
binary formatted waveform data. I'm trying to use RIB encoded 
(Intel-endian binary) waveform data, 4-byte words.

I'm hoping to read 10 waveforms per second on a periodic scan of an 
EPICS waveform record, (500 integer data points).

A simple bit of C code is able to read waveforms at about 80 waveforms 
per second in a tight loop. In there, I have used the 'ibeos()' function 
to cause my C code to not terminate reads on any character delimiters, 
and this seems to have the desired effect. In the gpib.conf file, I've 
include the setting:

set-reos = no

There is also the setting...

eos = ___

    ... which I've set to 0x0, commented out completely, and set to 
0x0a, none of which seems to change anything, and which is in accordance 
with my expectation.

Most/some of the settings in gpib.conf seem to correspond to the 
capabilities of the asynSetOption() function which I've also used in the 
EPICS startup script. There, it does seem to make a difference. If I set...
asynSetOption("GPIB0",10,0x0c,0)
...then asynTrace shows me that it does two things:
    1. terminates its sequential reads on each binary zero byte
    2. times out at the end of the read (and sees/reads the trailing LF)

I seem to be stuck between a rock and a hard place: either I use an 
end-of-line terminator, which will eventually show up in the binary data 
and prematurely terminate the read, or if I try to use the option to not 
use end-of-message characters, it will wait until the read times out, 
which seems to have the effect of invalidating the record, and slowing 
things down a lot.
Any hints on how to proceed, tests to make or requests for further info 
are welcomed.
Thanks.

Rod Nussbaumer
ISAC Controls, TRIUMF
Vancouver, Canada.



References:
Reading scope waveforms with StreamDevice + asyn Rod Nussbaumer

Navigate by Date:
Prev: Reading scope waveforms with StreamDevice + asyn Rod Nussbaumer
Next: RE: Does areaDetector Prosilica driver support Manta-series camera ? tom.cobb
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Reading scope waveforms with StreamDevice + asyn Rod Nussbaumer
Next: Re: Reading scope waveforms with StreamDevice + asyn Dirk Zimoch
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·