Could it be that the device is actually sending back 32 bytes of data? If the input buffer size is <=32 bytes, then I think the writeRead will succeed as soon as the buffer is full. But if you define a larger buffer it will wait until the timeout before returning with the timeout error code.
Did you define end-of-stream characters using setInputEos and setOutputEos?
Cheers,
Matt
On Oct 11, 2013, at 4:58 PM, Mark Rivers <[email protected]> wrote:
> 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
>
- References:
- VXI11 - GPIB Zenon Szalata
- RE: VXI11 - GPIB Mark Rivers
- Navigate by Date:
- Prev:
RE: VXI11 - GPIB Mark Rivers
- Next:
Re: VXI11 - GPIB Zenon Szalata
- 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: VXI11 - GPIB Mark Rivers
- Next:
Re: VXI11 - GPIB Zenon Szalata
- 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
|