You definitely don't need to write your own version of asynIPPort, since you know that the existing version works OK when used with the asynOctetWriteRead iocsh command. I'm sure it will also work fine with the asyn record. I suspect it will also work fine with streamDevice. Have you considered using streamDevice to talk to the device?
Mark
________________________________
From: [email protected] [[email protected]] on behalf of Andrew Wagner [[email protected]]
Sent: Wednesday, November 07, 2012 10:49 PM
To: Eric Norum
Cc: [email protected]
Subject: Re: Problems sending \x0 with devGpib driver
Hey Eric,
Thanks for the advice and commiserating. I already wrote a standalone C++ program to communicate with this thing and it took a little while to write the functions to append and strip \x0\x7 on/off of every string I sent/received from it. It really amazed me that they chose to start every command with \x0 since thats what the entire rest of the world has agreed means end of string. I was hoping to avoid having to write my own version of AsynIPPort just to deal with the \x0\x7 bytes.
Cheers,
Andrew
On Nov 7, 2012, at 8:41 PM, Eric Norum wrote:
I never cease to be amazed by the weird command sets that instrument designers are capable of creating.
About the only thing that I can think of right away is to specify GPIBCVTIO rather than GPIBREAD. You'll have to supply a convert() routine that does the I/O operations explicitly. An example of this is included in the ASYN documentation.
On Nov 7, 2012, at 7:57 PM, Andrew Wagner <[email protected]<mailto:[email protected]>> wrote:
Hey everyone,
I'm having trouble sending a byte array via an asyn devGpib driver I'm writing for an STM23S-2EE Applied Motion Products. The problem occurs when I define:
static struct gpibCmd gpibCmds[] = {
/* Param 0 - On-chip temperature in deg C*/
{&DSET_AI, GPIBREAD, IB_Q_HIGH, "\x0\x07\x49\x54\x30", NULL, 0, 100, readTemp, 0, 0, NULL, NULL, NULL}
}
and process the linked record:
epics> write 1
0d
I only write a single byte (in this case the appropriate eos character \r) If I try to send the message with an asynOctet I get the desired result:
asynOctetWriteRead("test","\x0\x7\x49\x54\x30",10)
epics> write 6
00 07 49 54 30 0d
epics> read 9
00 07 49 54 3d 35 34 37 0d
(I'm formatting the debug messages to print hex in case you're curious) Its clear that the command char* defined in the gpibCmd struct is being recast or formatted somehow outside of my driver and that when this occurs the \x0 is interpreted as an end of character array so no message is written. AsynOctet however interprets the char* as literal bytes. I would be very grateful if some has experience with Applied Motion products drivers or using devGpib to send byte arrays. I've had a lot of luck in the past using the devGpib template to write drivers and this is the first time I've had trouble with it actually sending what I wanted.
Cheers,
Andrew
======================
Andrew Wagner
Postdoctoral Researcher
Department of Physics
University of Washington
[email protected]<mailto:[email protected]>
======================
--
Eric Norum
[email protected]<mailto:[email protected]>
======================
Andrew Wagner
Postdoctoral Researcher
Department of Physics
University of Washington
[email protected]<mailto:[email protected]>
======================
- References:
- Problems sending \x0 with devGpib driver Andrew Wagner
- Re: Problems sending \x0 with devGpib driver Eric Norum
- Re: Problems sending \x0 with devGpib driver Andrew Wagner
- Navigate by Date:
- Prev:
Re: Problems sending \x0 with devGpib driver Andrew Wagner
- Next:
Re: Problems sending \x0 with devGpib driver Eric Norum
- 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: Problems sending \x0 with devGpib driver Andrew Wagner
- Next:
Re: Problems sending \x0 with devGpib driver Eric Norum
- 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
|