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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Problems sending \x0 with devGpib driver |
From: | Andrew Wagner <[email protected]> |
To: | [email protected] |
Date: | Wed, 7 Nov 2012 19:57:18 -0800 |
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] ====================== |