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 Mark Rivers
- Navigate by Date:
- Prev:
OMS MAXv default limit switch mode Ron Sluiter
- Next:
RE: VXI11 - GPIB Mark Rivers
- 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:
OMS MAXv default limit switch mode Ron Sluiter
- Next:
RE: VXI11 - GPIB Mark Rivers
- 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
|