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: Problems sending \x0 with devGpib driver
From: Andrew Wagner <[email protected]>
To: Eric Norum <[email protected]>
Cc: [email protected]
Date: Wed, 7 Nov 2012 20:49:08 -0800
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]> 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]
======================



-- 
Eric Norum
[email protected]





======================
Andrew Wagner
Postdoctoral Researcher
Department of Physics
University of Washington
[email protected]
======================



Replies:
RE: Problems sending \x0 with devGpib driver Mark Rivers
Re: Problems sending \x0 with devGpib driver Eric Norum
References:
Problems sending \x0 with devGpib driver Andrew Wagner
Re: Problems sending \x0 with devGpib driver Eric Norum

Navigate by Date:
Prev: Re: Problems sending \x0 with devGpib driver Eric Norum
Next: RE: Problems sending \x0 with devGpib driver Mark Rivers
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: Re: Problems sending \x0 with devGpib driver Eric Norum
Next: RE: Problems sending \x0 with devGpib driver Mark Rivers
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 ·