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

Subject: RE: VXI11 - GPIB
From: Mark Rivers <[email protected]>
To: "'Zenon Szalata'" <[email protected]>, "[email protected]" <[email protected]>
Date: Fri, 11 Oct 2013 20:58:20 +0000
Something does not seem right here, I don't understand why it is failing if nbt > 32.

Unfortunately I have no experience with VXI11, and I don't have any VXI11 devices to test with.  Hopefully someone else on tech-talk can help you with this.

When the writeRead fails, what is the error return?

What do you see if you set asynTraceMask=255 in the underlying VXI11 port (L0x)?

Mark


-----Original Message-----
From: Zenon Szalata [mailto:[email protected]] 
Sent: Friday, October 11, 2013 3:34 PM
To: Mark Rivers; [email protected]
Subject: VXI11 - GPIB

Hi Mark,
I have written a device driver for a GPIB device that is using VXI11 
protocol.
The device driver is sub-classed from the asynPortDriver class.
In the st.cmd file I configure the VXI11 object as follows:
vxi11Configure( "L0x","$(ETHER)",0,0.0,"gpib0",0,0)

Then in the constructor I connect:

stat=pasynOctetSyncIO->connect( _ioPort,_addr,&_apvt,0);

finally in IO routine I call:

stat=pasynOctetSyncIO->writeRead( 
_apvt,pcs,ncb,_buf,nbt,1,(size_t*)nio,&nbi,&eom);

_buf is defined as char _buf[2048]

I have discovered by trial and error that the writeRead succeeds for nbt 
<= 32 and fails otherwise.
I do not understand this.  I think that nbt is supposed to be the size 
of the read buffer (in my case _buf) simply telling the routine, which 
ultimately does the device IO, to put up to nbt bytes of data into the 
read buffer.  Now, it happens that in my test case the device returns 
only one byte of data, that is the status byte. So, why should it fail 
when I give the writeRead a ridiculously large buffer to read into?

Then what if I poke the device and it chooses to reply by sending 1024 
bytes of data?  Do I need to worry about that and issue the writeRead 
number of times with 32 byte long read buffer until all bytes of data 
are read in?  Since I don't know before hand how much data will be 
returned, it is not obvious to me how this could be done efficiently.
Thanks Mark,
Zen


Replies:
Re: VXI11 - GPIB Pearson, Matthew R.
Re: VXI11 - GPIB Zenon Szalata
References:
VXI11 - GPIB Zenon Szalata

Navigate by Date:
Prev: VXI11 - GPIB Zenon Szalata
Next: Re: VXI11 - GPIB Pearson, Matthew R.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: VXI11 - GPIB Zenon Szalata
Next: Re: VXI11 - GPIB Pearson, Matthew R.
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·